0
how to increase count whenever a specific input is entered in python
please help it is not working
8 odpowiedzi
+ 2
Try putting that if-statement in the same for-loop where you're making the variable for ask.
You can leave the print statement out of it though.
+ 2
please make better use of the tags next time you ask a question, they are a great place to specify the language you use.
+ 1
Do you have an attempt that you can show us?
+ 1
people = int(input("how many people are there?"))
count = 0
for i in range(people):
ask = input("you like anime")
if ask == "yes":
count += 1
print(count)
+ 1
You need to indent the if statement such that it is part of the for loop.
0
yes
0
how??? Justice
0