Added week 6

This commit is contained in:
2026-04-13 09:45:45 +08:00
parent 923c041dd6
commit 9b90ac4340
7 changed files with 139 additions and 0 deletions

21
week6/ex3.py Normal file
View File

@@ -0,0 +1,21 @@
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()