摘要: >>> tag = True >>> test1 = {} >>> type(test1) <class 'dict'> >>> while tag: name = input("please input your name: ") mountain = input("which mountain 阅读全文
posted @ 2021-01-02 19:46 小鲨鱼2018 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1、 >>> test1 = ["aa","bb","aa","cc","aa","cc","dd","ee"] >>> test1 ['aa', 'bb', 'aa', 'cc', 'aa', 'cc', 'dd', 'ee'] >>> "aa& 阅读全文
posted @ 2021-01-02 19:10 小鲨鱼2018 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 1、 >>> a = {} >>> while a != "quit": a = input("please input an incredient:") if a != "quit": print(f"{a} will be added!!") please input an incredient 阅读全文
posted @ 2021-01-02 14:28 小鲨鱼2018 阅读(87) 评论(0) 推荐(0) 编辑
摘要: >>> while True: a = input("please input something:") if a == "ab": break else: print(f"you had input {a}.") please input something:100 you had input 1 阅读全文
posted @ 2021-01-02 13:41 小鲨鱼2018 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1、 >>> tag = True >>> while tag: a = input("please input something : ") if a == "quit": tag = False else: print(a) please input something : 100 100 pl 阅读全文
posted @ 2021-01-02 13:20 小鲨鱼2018 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 1、 >>> a = "" >>> while a != "quit": a = input("please input a str or 'quit' to leave: ") print(a) please input a str or 'quit' to leave: 100 100 plea 阅读全文
posted @ 2021-01-02 12:38 小鲨鱼2018 阅读(102) 评论(0) 推荐(0) 编辑
摘要: >>> for i in range(1,11): if i % 4 == 0: print(i) 4 8 >>> for i in range(1,11): if i % 4 == 0: break print(i) 1 2 3 >>> for i in range(1,11): if i % 4 阅读全文
posted @ 2021-01-02 11:15 小鲨鱼2018 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 1、 >>> i = 1 >>> sum = 0 >>> while i <= 100: sum = sum + i i = i + 1 ## 当此处i等于101时循环停止 >>> print(sum) 5050 2、 >>> a = 100 >>> b = int(input("please in 阅读全文
posted @ 2021-01-02 10:43 小鲨鱼2018 阅读(115) 评论(0) 推荐(0) 编辑