View time04.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import calendar | |
#calendar.month(年, 月) | |
print(calendar.month(2020, 5)) |
View time03.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
t = time.time() | |
result = time.ctime(t) | |
print(result) |
View time02.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
result = time.localtime() | |
print(result) |
View time01.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
time = time.time() | |
print(time) | |
result = time / (24 * 60 * 60 * 365) + 1970 | |
print(result) |
View set0.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set1 = {1,2,3} | |
set2 = set((1, 2, 3)) | |
print(set1) # 打印出{1, 2, 3} | |
print(set2) # 打印出{1, 2, 3} |
View sey_02.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = {1,2,3} | |
a.remove(1) | |
print(a) | |
# 打印出{2, 3} |
View set_01.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = {1, 2, 3} | |
a.add(4) | |
print(a) | |
# 打印出{1, 2, 3, 4} |
View dict_12.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
person = {'name': 'Amy', 'age': '18'} | |
for i in person.items(): | |
print(i) | |
# 打印出('name', 'Amy') ('age', '18') |
View dict_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
person = {'name': 'Amy', 'age': '18'} | |
for i in person.values(): | |
print(i) | |
# 打印出 Amy 18 |
View dict_10.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
person = {'name': 'Amy', 'age': '18'} | |
for i in person.keys(): | |
print(i) | |
# 打印出 name age |
NewerOlder