您好我试图制作我的节目,因此用户将进入一周中的几天,结果应该是"星期一 - > M y" "星期二 - > T y"我希望它能给我当天的第一封和最后一封信,但是当我执行我的代码时,它只是给我输入最后输入的所有内容。这是我的代码
strings = []
user_input = ""
for days in range (7):
user_input = input("Enter a first name. Enter END to stop the program.. ")
strings.append(user_input)
print(strings)
str = 0
while ( str <= 7):
last_str_1st_char = user_input[0]
last_str_2st_char = user_input[0]
last_str_3st_char = user_input[0]
last_str_4st_char = user_input[0]
last_str_5st_char = user_input[0]
last_str_6st_char = user_input[0]
last_str_7st_char = user_input[len(user_input) - 1]
str = str + 1
print("Monday --->",last_str_1st_char, "Tuesday--->",last_str_2st_char, "Wendsday--->", last_str_3st_char,"Thursday--->",last_str_4st_char, "Friday--->",last_str_5st_char "Saturday--->",last_str_6st_char "Sunday--->", last_str_7st_char )
答案 0 :(得分:0)
shift_duration