"或"在该计划中无效

时间:2018-01-05 21:57:17

标签: python

print("enter the names of guest")
guest= []#empty list
name = " " #empty string
while name != "done" or "DONE" #while loop to continue asking the user for names that are not equal to done or DONE.
 name= (input ('enter the names of guest (enter done or DONE if there are no more names): ')#taking the the names from the user.
 if name.lower() != 'done' or name.upper() != 'DONE'# escape adding the done or DONE to the list.
 guest.append(name)# adding the list from the user to the empty list..

guest.sort()#以有序的方式放置列表     打印(客体)

0 个答案:

没有答案