把具体的年份处理成为年代

版权声明:诸葛老刘所有 https://blog.csdn.net/weixin_39791387/article/details/82706403

1988 转为 1980s

year = 1988

# 关键部分
temp = 10 * (year // 10)

years = str(temp) + 's'

print(years)

# '1980s'

猜你喜欢

转载自blog.csdn.net/weixin_39791387/article/details/82706403