Files
inf-kswo/IO/Idioms.py
Janis Hutz ede0ee318b Format
There really is no hope of making this code even half-way decent without
spending the time to rewrite them all properly. Don't want to do any of
that
2025-11-03 17:08:35 +01:00

40 lines
595 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)
# Sum up
sum = 0
for i in range(100):
n = random.randint(1, 1000)
sum += n
print(sum)
# even or uneven?
z = random.randint(1, 1000)
if (z % 2) == 1:
print("odd")
else:
print("even")