+ 2

Help me

I have written a code but it is causing problem please help me x = int(input()) y = int(input()) z = int(input()) d = y-x e = z-y a = d+z if d ==e: print("Your input sequence was",x,y,z,"\n""Next term will be", a) else: (statement) please help for adding this feature Thanks https://code.sololearn.com/ce1Dl85m7H6e/?ref=app

26th Mar 2018, 3:48 PM
Aditya Rawat
3 Answers
+ 3
26th Mar 2018, 4:26 PM
Hanz
Hanz - avatar
+ 6
Your linked code doesn't match your posted code. The linked gave 35 for 15, 20, & 30, which seems reasonable to me. The posted code won't run as the print is not indented so the if doesn't have one or more statements as required.
26th Mar 2018, 4:11 PM
John Wells
John Wells - avatar
+ 5
@John Wells Thanks for help The code doesn't match because it was not working and I had decided to do not use that and then I made it much simpler
26th Mar 2018, 4:17 PM
Aditya Rawat