摘要: 1*1=1 1*2=2 2*2=4 1*3=3 2*3=6 3*3=9 1*4=4 2*4=8 3*4=12 4*4=16 1*5=5 2*5=10 3*5=15 4*5=20 5*5=25 1*6=6 2*6=12 3*6=18 4*6=24 5*6=30 6*6=36 1*7=7 2*7=14 阅读全文
posted @ 2019-01-12 20:57 SKING_Python 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 1 #Python3 格式化输出 占位符%s %d %f 2 name = input("Name:") 3 age = int(input("Age:")) 4 #input默认接受的都是字符串类型,所以要输出%d整型,就要先把字符串强制转换成整型 5 job = input("Job:") 6 salary = input("Salary:") 7 8 info = ""... 阅读全文
posted @ 2019-01-12 20:52 SKING_Python 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 1 #Python3 三元表达式 2 #result = 值1 if 条件 else 值2 如果条件成立result = 值1 如果条件不成立 result = 值2 3 4 a, b, c = 1, 3, 5 5 d = a if a>b else c 6 print(d) #结果:5 阅读全文
posted @ 2019-01-12 20:51 SKING_Python 阅读(1704) 评论(0) 推荐(0) 编辑