Files
ICSP1-Works/week6/ex3.py
2026-04-13 09:45:45 +08:00

21 lines
473 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
def main():
print('==Exercise 3==')
flag=True
while flag:
a = input("pls input a number:")
try:
a = int(a)
flag=False
except :
print("pls input a number!")
print(f"Test if the number {a} is even: {True if a%2==0 else False}")
#我其实挺想直接a%2==0的不过尊重一下本节课的主题
print('==End Of Ex3==')
return 0
if __name__ == '__main__':
main()