Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if-elif-else coding help
#3
The if statement I tried was:

If len(mystr) < 6
print(‘<mystr> is not a valid str’)
else:
print(‘<mystr> is valid’)

Based on the program I need to write, I understand the else statement should not be written there yet however, I just wanted to test if these if and else statements work. I am getting a “Syntax” error next to the “...< 6” line.
Reply


Messages In This Thread
if-elif-else coding help - by esyfilamaj - Oct-29-2018, 10:18 PM
RE: if-elif-else coding help - by ichabod801 - Oct-30-2018, 01:20 AM
RE: if-elif-else coding help - by esyfilamaj - Oct-30-2018, 01:26 AM
RE: if-elif-else coding help - by ichabod801 - Oct-30-2018, 02:31 AM
RE: if-elif-else coding help - by nilamo - Oct-30-2018, 03:00 AM
RE: if-elif-else coding help - by esyfilamaj - Oct-30-2018, 10:13 PM
RE: if-elif-else coding help - by nilamo - Oct-30-2018, 11:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python coding mutiple elif's metro17 1 1,855 Aug-02-2019, 10:27 AM
Last Post: metulburr
  Whats the right way to refactor this Big if/elif/elif ? pitosalas 1 2,315 Jul-28-2019, 05:52 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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