+ 2

I Am beginner Show me the wrong In this code.

age = int(input()) if age <= 12: print("You are a child") else if: age <=25: print ("You are Young") else: print("You are middle age or old")

21st Aug 2016, 11:29 AM
Rokon
11 Respuestas
+ 7
above code so many indentation errors are there please note if write anything before learn syntax errors ex: ag=int(raw_input()) if ag<=12: print ag else: print 'age is high' I hope that this ishelpful for u
23rd Aug 2016, 3:29 PM
Boorsu Gangadharam
Boorsu Gangadharam - avatar
+ 7
here I wrote the complete code you can just copy and paste it in your idle age = int(input()) if age <= 12: print("You are a child") elif age <=25: print ("You are Young") else: print("You are middle age or old") I hope that this is helpful for u
8th Nov 2016, 3:25 PM
Boorsu Gangadharam
Boorsu Gangadharam - avatar
+ 5
in python else if written as elif condition:
8th Nov 2016, 3:19 PM
Boorsu Gangadharam
Boorsu Gangadharam - avatar
+ 3
'else if' in python is writen as 'elif'
21st Aug 2016, 3:14 PM
Suzakotsu Code
Suzakotsu Code - avatar
+ 3
age = int(input()) if age <= 12: print("You are a child") elif age <=25: print ("You are Young") else: print ("You are middle age")
26th Aug 2016, 1:02 PM
Alexey
+ 1
Try elif age<=25: instead of else if: age<=25:
23rd Aug 2016, 1:47 AM
Alexey
+ 1
show how use Else if or elif Boorsu Brother
23rd Aug 2016, 8:13 PM
Rokon
+ 1
age = int(input()) if age <= 12: print("You are a child") else: if age <=25: print ("You are Young") else: print("You are middle age or old") #this should help you if you intend to use else statements. #Otherwise you could use elif: in place of the first else statement. age = int(input()) if age <= 12: print("You are a child") elif age <=25: print ("You are Young") else: print("You are middle age or old") Hoping I've been of great help Sir.
1st Oct 2016, 7:42 AM
Umar Muhummed
Umar Muhummed - avatar
0
alexey brother please you write and run the code and give me solution
23rd Aug 2016, 5:53 AM
Rokon
0
this is not python 3 just a heads up python 3 does not have raw input and needs parentheses for print
8th Sep 2016, 1:16 PM
Brandon Lin
Brandon Lin - avatar
0
not bad😆
19th Nov 2016, 12:48 PM
abdi