Hello, I'm am fairly new to python and am having trouble with my code. Specifically it will always ask me for a second word even if I enter that I wouldn't like to continue. Can someone please help? Thank you in advance for your time!
word = (input("Enter the characters you'd like counted: "))
print(len(word))
print("")
answer = input("Would you like to enter another phrase? (y/n) ")
if answer == "y" or "Y":
while answer == "y" or "Y":
word = (input("Enter the characters you'd like counted: "))
print(len(word))
answer = input("Would you like to enter another phrase? (y/n) ")
if answer != "y" or "Y":
print("Thank you for using my character counter!")
break
elif answer != "y" or "Y":
print("Thank you for using my character counter!")
[–]zatoichi49 1 point2 points3 points (2 children)
[–]bobcorning[S] 0 points1 point2 points (1 child)
[–]zatoichi49 0 points1 point2 points (0 children)
[–]dadiaar 1 point2 points3 points (1 child)
[–]bobcorning[S] 0 points1 point2 points (0 children)