inf-kswo/IO/Idioms.py
2025-01-20 19:41:45 +01:00

39 lines
600 B
Python
Executable File

#Idioms
import random
#Check user input
s = 200
while (s < 1) or (s > 99):
s = int(input("Zahl: "))
if (s < 1) or (s > 99):
print("Number not within designated range. Try again")
print("Ok")
#Find biggest number
output = 0
for i in range(100):
n = random.randint(1, 1000)
if n > output:
output = n
print(output)
#Summ up
summ = 0
for i in range(100):
n = random.randint(1, 1000)
summ += n
print(summ)
#even or uneven?
z = random.randint(1, 1000)
if (z % 2) == 1:
print("odd")
else:
print("even")