0
Please answer why indentation error occur? And how to remove this?
val=int(input("enter value")) count=2 while count<=val: value=2;num=0 while value<=val and value<=count: if count%value==0: num+=1 value+=1 if num==2 : print(value,sep=",",end="") count=count+1
5 Respuestas
+ 1
Your if statement is not matching with any outer while loop needed identation.
Check these for how many spaces there need
val=int(input("enter value"))
count=2
value=2
num=0
while count<=val:
while value<=val and value<=count:
if count%value==0:
num+=1
value+=1
if num==1:
print(value,sep=",",end="")
count=count+1
+ 1
Give a tab for the statements that you are writing inside a loop or any conditional statements or inside any functions... Then you won't get any IndentationError
0
Thanks
0
Thanks
0
In built python follows the indentation rule... No one can change it... One must follow the rule for effective programming