摘要: # 使用While循环实现输出2-3+4-5+6...+100的和。number = 2total = 0while number <= 100: if number % 2 == 0: total += number elif number % 2 == 1: total -= number nu 阅读全文
posted @ 2018-11-17 21:53 demilyc 阅读(4004) 评论(0) 推荐(0) 编辑
摘要: # 实现用户输入用户名和密码,当用户名为seven或者Alex且密码为123时,显示登录成功,否则失败,失败时允许重复输入三次。count = 0while count < 3: username = input("Please enter your username: ") password = 阅读全文
posted @ 2018-11-17 21:42 demilyc 阅读(3998) 评论(0) 推荐(0) 编辑
摘要: # 实现用户输入用户名和密码,当用户名为seven且密码为123时,显示登录成功,否则失败,失败时允许重复输入三次。count = 0while count < 3: username = input("Please enter your username: ") password = input( 阅读全文
posted @ 2018-11-17 21:36 demilyc 阅读(3457) 评论(0) 推荐(0) 编辑
摘要: # 写代码# 实现用户输入用户名和密码,当用户名为seven且密码为123时,显示登录成功,否则登录失败。username = input("Please enter your username: ")password = input("Please enter your password: ")i 阅读全文
posted @ 2018-11-17 21:27 demilyc 阅读(5457) 评论(0) 推荐(0) 编辑
摘要: Python中,如何查看变量在内存中的地址? >>> id(variable_name) example: >>> name = "Linda" >>>print( id(name) ) # id(x)得到x变量的内存地址(10进制) 阅读全文
posted @ 2018-11-17 21:03 demilyc 阅读(2329) 评论(0) 推荐(0) 编辑