migration from cloud service

This commit is contained in:
2026-03-23 22:41:03 +08:00
commit e1d2d137c5
15 changed files with 283 additions and 0 deletions

27
week4/ex2.py Normal file
View File

@@ -0,0 +1,27 @@
def main():
print('==Exercise 2==')
print('formula: s=3.14 * (1+a/b)^3')
flag = True
while flag:
a = input("pls input number a:")
try:
a = int(a)
flag=False
except :
print("pls input a number!")
flag=True
while flag:
b = input("pls input number b:")
try:
b = int(b)
flag=False
except :
print("pls input a number!")
print(f"The result for S= {3.14*(1+(a+b)**3)}")
print('==End Of Ex2==')
return 0
if __name__ == '__main__':
main()