• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
7 views

Problem :

In Python, code blocks are defined by the tabs, not by the ";" at the end of the line

if number > 10 and number < 25:
    print "1"

Is mutliple lines possible in python? like...

if number > 10 
and number < 25:
    print "1"

by (6.9k points)  

1 Answer

0 votes

Solution : 

PFB the solution for your problem

Method 1: Using parenthesis

if (number > 5 and
        number < 15):
    print "1"
Method 2: Using backslash
if number > 5 and \
number < 15:
    print "1"

Method 3: Using backslash + indent for better readability

if number > 5 and \
        number < 15:
    print "1"

by (22.5k points)  
edited by
...