Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Convert the following code to an if-elif-else statement.(using python) code = in

ID: 3754508 • Letter: C

Question

Convert the following code to an if-elif-else statement.(using python)

code = input("Enter a code value <11, 22, 33>: ")

if code == '11':

    print("11: score one")

else:

    if code =='22':

        print("22: street and road")

        print("Street: Hastings St.")

        print("road: Boundary Road.")

    else:

        if code == "33":

            print("33: Three items")

            print("a. apple")

            print("b. baby")

        else:

            print("Other things")

print("Finish")

Explanation / Answer

code = input("Enter a code value : ") if code == '11': print("11: score one") elif code == '22': print("22: street and road") print("Street: Hastings St.") print("road: Boundary Road.") elif code == "33": print("33: Three items") print("a. apple") print("b. baby") else: print("Other things") print("Finish")