Initialer Import der Synology Scripts

This commit is contained in:
root
2026-08-05 08:43:57 +02:00
commit 5e32a7c411
404 changed files with 79932 additions and 0 deletions
@@ -0,0 +1,26 @@
"""Exercise 2:
1.)
Write code that uses a list of integer and one integer number "a".
There you should print the index where the number is present in the list.
2.)
Write code that takes two integers (x, y) computes the following:
Sum up all integer numbers from x (inclusive) to y (non-inclusive)
with a step width of 2.
"""
# exercise1
lst = [1, 2, 3]
a = 3
if a in lst:
print(lst.index(a))
# exercise2
x = 2
y = 10
result = 0
for i in range(x, y, 2):
result += i
print(result)