8th Aug 2019, 3:17 PM
sathya
sathya - avatar
10 Antworten
8th Aug 2019, 3:22 PM
VEDANG
VEDANG - avatar
+ 3
Ooo thank u
8th Aug 2019, 4:14 PM
sathya
sathya - avatar
+ 1
This is the right code: print("Options \n") print("1.To add\n") print("2.To subtract\n") print("3.To multiply\n") print("4.To divide\n") x= int(input("Enter your choice\n")) if x==1 : num1=int(input("Enter 1st number to be added\n")) num2=int(input("Enter 2nd number yo be adeed\n")) sum=num1+num2 print("sum" , sum) elif x==2: num1=int(input("Enter 1st number to be subtracted\n")) num2=int(input("Enter 2nd number yo be subtracted\n")) sub=num1-num2 print("sub" , sub) elif x==3: num1=int(input("Enter 1st number to be miltiplied\n")) num2=int(input("Enter 2nd number yo be multiplied\n")) pro=num1*num2 print("product" , pro) elif x==4: num1=int(input("Enter 1st number to be divided\n")) num2=int(input("Enter 2nd number yo be divided\n")) quo=num1//num2 print("quotient" , quo)
8th Aug 2019, 3:26 PM
Davide Mornatta
Davide Mornatta - avatar
+ 1
I had to remove the indentation, that is not needed in the first five lines, and I had to adjust the indentation inside the "if" cycles. Furthermore, I had to substitute "insert" with "input" and correct the first "if" sentence.
8th Aug 2019, 3:27 PM
Davide Mornatta
Davide Mornatta - avatar
+ 1
https://code.sololearn.com/cphBNc2M7Iuk/?ref=app Still it showing error in line 7
8th Aug 2019, 4:05 PM
sathya
sathya - avatar
0
what is this language sir
9th Aug 2019, 3:11 AM
Congo43
- 1
print("Options \n") print("1.To add\n") print("2.To subtract\n") print("3.To multiply\n") print("4.To divide\n") x = int(input("Enter your choice\n")) if x==1: num1=int(input("Enter 1st number to be added\n")) num2=int(input("Enter 2nd number yo be adeed\n")) sum=num1+num2 print("sum" , sum) elif x==2: num1=int(input("Enter 1st number to be subtracted\n")) num2=int(input("Enter 2nd number yo be subtracted\n")) sub=num1-num2 print("sub" , sub) elif x==3: num1=int(input("Enter 1st number to be miltiplied\n")) num2=int(input("Enter 2nd number yo be multiplied\n")) pro=num1*num2 print("product" , pro) elif x==4: num1=int(input("Enter 1st number to be divided\n")) num2=int(input("Enter 2nd number yo be divided\n")) quo=num1//num2 print("quotient" , quo) mostly indentation errors and you somethimes wrote insert instead of input ...
8th Aug 2019, 3:24 PM
Anton Böhler
Anton Böhler - avatar