Bootstrap

Python 实现输入一个数字,就输出该数字对应的周几的英文单词

题目要求:

创建一个字典,存放周几所对应的英文单词,

week ={1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday",7:"Sunday"},

要求编写程序:实现输入一个数字,就输出该数字对应的周几的英文单词。

week = {1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday",7:"Sunday"}
i = int(input())
print(week[i])

运行效果:2101c281889745dd97bfc212107f783d.png

 

 

;