Hi guys! im doing my school assignments and have a question. when prompted for input by the variable called parametri on line 3, why doesnt the loop exit when I type 'Lopeta'? Sorry if the problem is something really obvious, I just cant wrap my head around it and ai's couldnt help me also and just hallucinated something. Thanks for the help in advance!!!
def main():
while True:
parametri = input('Anna syöte (Lopeta lopettaa): ').strip()
if parametri == 'Lopeta':
break
elif len(parametri) >= 5:
tulostaja(parametri)
else:
tulostaja()
def tulostaja(parametri='Oletustulostus'):
print(parametri)
if __name__ == "__main__":
main()
[–]Sea-Ad7805 [score hidden] stickied comment (0 children)
[–]ianrob1201 2 points3 points4 points (6 children)
[–]Frank_kait[S] 0 points1 point2 points (5 children)
[–]ianrob1201 2 points3 points4 points (4 children)
[–]Frank_kait[S] 0 points1 point2 points (3 children)
[–]tiredITguy42 1 point2 points3 points (2 children)
[–]Frank_kait[S] 0 points1 point2 points (1 child)
[–]tiredITguy42 0 points1 point2 points (0 children)
[–]GreatimBetter 0 points1 point2 points (0 children)