0
Help for indentation and comment for my code
num = 12 if num > 5: print("Bigger than 5") if num <=15: print("Between 5 and 47") #indentation print("data") # cani write comments line before my code lines # want comment here before. print("source code")
3 ответов
+ 2
1) It seems that you are using nested if statement in python.. The general syntax for nested if statement in python as shown below
if(condition 1):
if(condition 2):
condition 2 ture statement
else:
condition 2 false statement
else:
condition 1 false statement
2) Comments are nothing but the lines which are ignored by the compiler and you can write comments anywhere inside the program
#This is for single line comment
""" This is for multi-line comment """
3) If you have problem with indentation then use pycharm
+ 2
PyCharm is an integrated development environment (IDE) used in computer programming specifically for the Python language.
0
whats pycharm???