Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if-elif-else coding help
#5
In addition, there should be a colon at the end of the if statement: if len(mystr) < 6:.
Furthermore, your quote characters are not actually quote characters. They're some sort of weird multi-byte horror, similar to the trash Microsoft Word frequently replaces quotes for. To demonstrate, here's a single quote character x, and the two different make-believe nonsense characters you had (they are NOT the same, and it DOES matter):
>>> x = "'"
>>> x.encode()
b"'"
>>> y = "‘"
>>> y.encode()
b'\xe2\x80\x98'
>>> z = '’'
>>> z.encode()
b'\xe2\x80\x99'
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