摘要: a=input("Please input a number:")def test(num): try: return float(a) except ValueError: return "请输入数字"print(test(a)) 阅读全文
posted @ 2024-02-07 14:58 飞虎就是我 阅读(34) 评论(0) 推荐(0)
摘要: s="I am welcome you!"num=0for i in s: if i=='m': num+=1print(num) 阅读全文
posted @ 2024-02-07 13:51 飞虎就是我 阅读(19) 评论(0) 推荐(0)
摘要: s="I am welcome you!"world="welcome"def function(): if world in s: return s.find(world) else: return -1print(function()) 阅读全文
posted @ 2024-02-07 11:39 飞虎就是我 阅读(26) 评论(0) 推荐(0)
摘要: x=input("please input a number:")if x==x[::-1]: print("是回文")else: print("不是回文") 阅读全文
posted @ 2024-02-07 11:26 飞虎就是我 阅读(44) 评论(0) 推荐(0)