Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Help
#2
The error came up, because you did used invalid syntax.
elif is being used within conditional structures, it is being used after a if.
You also have one = instead of ==.

Valid Syntax for that would look like
Code:
if b == 1:
    print "Some"
elif b == 2:
    print "thing"
else:
   print "this"

And you save files with an extension .py or .pyw isn't important which one!
Double click on that file should open up a MS-DOS or a Terminal window, if python was properly installed on the system.
Reply


Messages In This Thread
Python Help - by Dεlluzion - 02-13-2011, 05:02 AM
RE: Python Help - by Gaijin - 02-13-2011, 01:00 PM
RE: Python Help - by Doldol - 04-17-2011, 05:43 AM
RE: Python Help - by samsmith001 - 09-30-2019, 12:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple Python Python Compiler Canoris 21 8,487 06-01-2011, 06:30 PM
Last Post: Filefinder
  Python 2 vs 3? Jake 8 2,272 12-11-2010, 04:13 PM
Last Post: Bursihido
  Python help Kharnage 2 769 02-12-2010, 09:07 PM
Last Post: Kharnage
  "==" and "is" in Python Canoris 1 756 02-07-2010, 03:55 PM
Last Post: uber1337
  I Need Help with Python Kharnage 19 3,720 02-06-2010, 08:58 AM
Last Post: Kharnage

Forum Jump:


Users browsing this thread: 1 Guest(s)