Answer to Question #275438 in Python for Gabi

Question #275438

Please correct the error. There are syntax errors, logical errors and runtime errors.

1.

if x == y:
    print('Equal')

2.


x = 'hello'
y = ['hello']


if x == y:
    print('Equal')

3.


x = True


while x:
    for x in list(range(0,10)):
        print(x)

4.

myfunction(x, y):
    return x + y


    else:
        print("Hello!")


    if mark >= 50
        print("You passed!")


    if arriving:
        print("Hi!")
    esle:
        print("Bye!")


    if flag:
    print("Flag is set!")


Thank you for the help!


1
Expert's answer
2021-12-04T20:48:05-0500
x = y = 1
if x == y:
    print('Equal')


x = 'hello'
y = ['hello']

if [x] == y:
    print('Equal')


x = True

while x:
    for x in list(range(0,10)):
        print(x)
    break


mark = 100
arriving = True
flag = True

def myfunction(x, y):
    return x + y

print("Hello!")

if mark >= 50:
    print("You passed!")

if arriving:
    print("Hi!")
else:
    print("Bye!")

if flag:
    print("Flag is set!")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS