第二章 变量和简单数据类型
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
print("\tPython") print("Languages:\nPython\nC\nJavaScript") print("Languages:\n\tPython\n\tC\n\tJavaScript") favorite_language= 'python ' print(favorite_language) favorite_language.rstrip() favorite_language msg = "hello, \"he said.\" " print(msg) username = "lazygoat" words = "bye-bye." fullstc = username + ', ' + words print(fullstc) name = "haha hello" print(name.upper()) print(name.lower()) print(name.title()) age = 23 # msg = "happy " + age + "rd birthday!" msg = "happy " + str(age) + "rd birthday!" print(msg) print(5 + 3) print(2 * 4) print(2 ** 3) print(16 // 2) print(16 - 8) import this |