Computer Science, asked by rmanojdivya000, 11 months ago

Find errors in the following code(if any) and correct the code by rewriting it and underlining

corrections.


x=int(“Enter value for x))

for in range[0,11]:

if x=y

print x+y

else:

print x-y

waiting for early replies guys....​

Answers

Answered by iAmButterBALL
76

Answer:

x=int(input("Enter value for x"))

for i in range(0,11):

if x=y:

print(x+y)

else:

print(x-y)

Answered by nvats1007
7

Answer:

x=int(input("Enter value for x"))

for i in range(0,11):

 if x==y:

   print(x+y)

 else:

     print(x-y)

Explanation:

as we know python is case sensitive the errors are as follow:

1. we have to write input in another bracket

2. for range we use parenthesis instead of square brackets

3. we put colon in the end of x=y

4.we put x+y in parenthesis ,similarly in print x-y

NOTE: we should always take care of indentation level

Similar questions