我无法在不同的行上打印我的代码- python 3.4.1
I can't print my code on seperate lines- python 3.4.1
#Creating empty list
movies = []
#Creating variable that will control number of DVD titles we can enter
dvds = 0
#Creating the while loop
while dvds < 1000000: #This ensures that a large amount of DVD titles can be entered depending on user's personal DVD collection
print ("Please enter a DVD from your personal collection- press the 'enter key' to stop adding movies")
next = input("> ")
#If conditional statement to verify input
if len(next) > 0 and next.isalpha():
movies.append(next)
dvds = dvds + 1 or dvds==''
else:
break
print (movies)
要打印列表,您可以使用
for movie in movies:
print(movie)
#Creating empty list
movies = []
#Creating variable that will control number of DVD titles we can enter
dvds = 0
#Creating the while loop
while dvds < 1000000: #This ensures that a large amount of DVD titles can be entered depending on user's personal DVD collection
print ("Please enter a DVD from your personal collection- press the 'enter key' to stop adding movies")
next = input("> ")
#If conditional statement to verify input
if len(next) > 0 and next.isalpha():
movies.append(next)
dvds = dvds + 1 or dvds==''
else:
break
print (movies)
要打印列表,您可以使用
for movie in movies:
print(movie)