我也是 Python 和 stackoverflow 的新手。我正在尝试编写一个可以区分奇数和偶数的程序,但我遇到了这个错误。帮助!。这是我的编:
print("Enter the 10 numbers separated by space to distinguish : ")
string1 = str(input())
if len(string1) == 10 or 20:
list1 = string1.split
for num in list1:
#check for odd
if num % 2 == 0 :
print(num)
else:
print(f'Odd number : {num}')
else:
print("Please enter 10 numbers")
慕的地10843
相关分类