Computer Science, asked by studyclass12withme, 6 months ago

Observe the following Python code very carefully and rewrite it after removing all

errors with each correction underlined:

DEF execmain():

x = int(input("Enter a number:"))

if(abs(x)= x):

print("You entered a positive number")

else:

x =* -1

print("Number made positive:"x)

execmain()​

Answers

Answered by Oreki
8

def execmain( ): # DEF

x = int(input("Enter a number - "))

if (abs(x) = = x): # =

print ("You entered a positive number")

else:

x *= 1 # =*

print("Number made positive:", x) # Comma missing

execmain( )

Similar questions