上传文件至「week12」

This commit is contained in:
2026-06-01 02:02:53 +00:00
parent 31078ddcf7
commit 185980b30f
5 changed files with 104 additions and 0 deletions

18
week12/ex2.py Normal file
View File

@@ -0,0 +1,18 @@
from continueanyway import ca
@ca
def ValidateInteger(i):
if type(i)==int:
print(f"{i} is a valid int")
return i
raise ValueError(f"The given number {i} is not a int")
def main():
ValidateInteger("10")
ValidateInteger(10.0)
ValidateInteger("dshjkfsdjhfkjsd")
ValidateInteger(10)
return 0
if __name__ == '__main__':
main()