1

Here is the code i have written

form=input("Have you counted your time with hours, minutes, or seconds?")

if form=="hours" or "Hours":
    timec="hour(s)"
    multiple="hours"

elif form=="minutes" or "Minutes":
    timec="minute(s)"
    multiple="minutes"

elif form=="seconds" or "Seconds":
    timec="second(s)"
    multiple="seconds"

print(multiple)

Everytime i run it and input "minutes" or "seconds", i get hours no matter what? Any help?

Danyal Rana
  • 33
  • 1
  • 4
  • 1
    Use `if form.lower() == "hours":` – Alex Hall Nov 06 '16 at 19:09
  • 1
    `if form == "hours" or "Hours"` is like writing `if form == "hours" or 1`, since the string `"Hours"` is always True. What you want to do is `if form == "hours" or form == "Hours"` (alternative: listen to Alex) – yuvi Nov 06 '16 at 19:16
  • Yep, that seemed to do the trick. Thank you very much :D – Danyal Rana Nov 06 '16 at 19:19

0 Answers0