Skip to Content

Code Avengers Python 1 Answers -

apple banana cherry Loops are used to execute a block of code repeatedly. The for loop iterates over a sequence (such as a list or tuple) and executes the block of code for each item. Exercise 5: Functions Question: What is the output of the following code?

x = 5 y = "5" print(x == y) The output of the code is False . This is because x is an integer and y is a string, even though they have the same value. code avengers python 1 answers

fruits = ["apple", "banana", "cherry"] for fruit in fruits: print(fruit) The output of the code is: apple banana cherry Loops are used to execute