Find the errors in the program attached. [Python] Please don't spam, thank you
Attachments:
![](https://hi-static.z-dn.net/files/dff/cd6f82b3c231afd5d873fb6c04b870af.png)
Answers
Answered by
10
Given còde :-
import math
x = float(input('Enter a no. :')
y = int(input ('Enter operation \n'
'1 for addition \n'
'2 for substracting\n'
'3 for multiply\n'
'4 for division\n'
'5 for exponent\n'
'6 for square root\n'))
Còde after correction :-
import math
x = float(input('Enter a no. :'))
y = int(input ('''Enter operation \n
1 for addition \n
2 for substracting\n
3 for multiply\n
4 for division\n
5 for exponent\n
6 for square root\n'''))
Explanation :-
Brackets or parentheses should be added correctly.
In order to print multiple lines, you have to use tripple quotes ''' (or " " " ) before and after the statements.
Similar questions
English,
1 month ago
Computer Science,
1 month ago
Math,
3 months ago
Business Studies,
11 months ago
Social Sciences,
11 months ago