Find the errors in the program attached. [Python] Please don't spam, thank you
Attachments:
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