Python Forum
Error with conditionals
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error with conditionals
#16
I'm going to try one more time.

if x > 5:
    if x == 18:
        print('something')
The first line is not indented. The second line is indented once. The third line is indented twice. You need to indent the last four lines one more time each. Indentation is essential to Python. It signifies sections of code that are tied to a particular statement. In this case, the if statements. If you do not understand indentation, you will not be able to program Python.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Error with conditionals - by RiceGum - Oct-17-2017, 12:37 AM
RE: Error with conditionals - by ichabod801 - Oct-17-2017, 12:50 AM
RE: Error with conditionals - by RiceGum - Oct-17-2017, 01:17 AM
RE: Error with conditionals - by ichabod801 - Oct-17-2017, 01:26 AM
RE: Error with conditionals - by RiceGum - Oct-17-2017, 06:54 PM
RE: Error with conditionals - by ichabod801 - Oct-17-2017, 07:32 PM
RE: Error with conditionals - by RiceGum - Oct-17-2017, 07:44 PM
RE: Error with conditionals - by ichabod801 - Oct-17-2017, 07:56 PM
RE: Error with conditionals - by RiceGum - Oct-17-2017, 09:06 PM
RE: Error with conditionals - by ichabod801 - Oct-17-2017, 09:19 PM
RE: Error with conditionals - by RiceGum - Oct-17-2017, 10:07 PM
RE: Error with conditionals - by Beatenberg - Oct-17-2017, 11:04 PM
RE: Error with conditionals - by RiceGum - Oct-17-2017, 11:36 PM
RE: Error with conditionals - by Beatenberg - Oct-18-2017, 12:03 AM
RE: Error with conditionals - by RiceGum - Oct-18-2017, 12:30 AM
RE: Error with conditionals - by ichabod801 - Oct-18-2017, 01:19 AM
RE: Error with conditionals - by RiceGum - Oct-18-2017, 01:33 AM
RE: Error with conditionals - by ichabod801 - Oct-18-2017, 01:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Functions with conditionals and comparison operators Drone4four 9 12,978 Jan-01-2019, 06:48 PM
Last Post: Drone4four
  Nested Conditionals Elero 3 7,956 Apr-16-2018, 07:58 PM
Last Post: Elero

Forum Jump:

User Panel Messages

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