Python Forum
If/Else If Statement Not Running
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If/Else If Statement Not Running
#4
Thanks to both of you. Two follow-up questions.

1 ) I'm getting an error message (see below) when I try to run the code deanhystad suggested. The error message has a caret symbol (^) pointing to the quotes at the end. Do either of you know why this is happening? I'm not sure if it has to do with the fact that my PyCharm is apparently using Python 3.4.

Line 3
print(f"Your weight in pounds is {weight * 2.2}")

SyntaxError: invalid syntax

2 ) Deanhystad, could you please explain what the [1] is or does in .lower()[1]? Is this simply a default value (and not necessary for the code to run correctly)?

Thanks again!
Reply


Messages In This Thread
RE: If/Else If Statement Not Running - by Larz60+ - Dec-08-2021, 03:09 PM
RE: If/Else If Statement Not Running - by new_coder_231013 - Dec-09-2021, 10:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Stop if statement from running KieranPage 3 1,987 May-05-2020, 04:10 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020