problem with first program | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

problem with first program

print('i will calculate your birh year') x=2016 y=int(input('write your age here:')) if y>0 print('this is your birth year') print(x-y)+print('end of the program') if y<0 print('oh your age cannot be - , try again') and ive got an error: SyntaxError:multiple statements found while compiling a single statement i dont know write new line to escape from this error whst should i change? help! ps.every line used one by one work ok but i dont know how to + them to 1 program :/

18th Oct 2016, 3:48 PM
krewki1
krewki1 - avatar
3 Answers
+ 2
in line 6 : use print(x-y) print('end of program') in separate lines
19th Oct 2016, 7:00 AM
Sunera
Sunera - avatar
0
Try \n in the string for a new line ...
18th Oct 2016, 8:12 PM
Thomas Hanke
Thomas Hanke - avatar
0
You have a typo line1: "birh" than later on, you wrote "birth"
19th Oct 2016, 9:12 AM
Zennar Ibrahim
Zennar Ibrahim - avatar