What's new

Pahelp naman po phyton

cookiezz_

Eternal Poster
Joined
May 7, 2022
Posts
316
Reaction
24
Points
260
def main():
movies = []
snacks = []

#Ask movies
for i in range(0,3):
print("Enter movie {} of 3: ".format(i), end='')
movie = input()
movies.append(movie)

#Ask snacks
for i in range(0,3):
print("Enter snack {} of 3: ".format(i),end="")
snack = input()
snacks.append(snack)

#print movies and snacks on separate lines
print("Movies to watch are {}",movies)
print("Snacks to eat are {}",snacks)

#Ask user to press S if snack finished
print("Press S each time you finish a snack")
while(snacks!=[]):
ch = input()
if(ch=="S"): snacks.pop(0)
print(snacks)
print("No more snacks")

if name == 'main':
main()

hindi ko po alam bakit ayaw amg work
 
Code:
if __name__ == "__main__":
    main()

better post mo rin kung magkakaroon ng error.
Sa current code mo wala talagang lalabas na error dahil hindi nage-execute yung main function
 
Last edited:
Back
Top