qobjects = [
{
question: "When does the else statement execute?",
options: [
"When the if condition is True",
"When the if condition (and any elif conditions) are False",
"Always"
],
correct: 1
},
{
question: "Can you have an else statement without an elif?",
options: [
"Yes",
"No",
"Only with nested if statements"
],
correct: 0
},
{
question: "Where must the else statement be placed?",
options: [
"At the beginning",
"Last in the if-elif-else chain",
"Before any elif statements"
],
correct: 1
},
{
question: "What will be the result of the following code:x = 5",
options: [
"Hello",
"Welcome"
],
correct: 1
},
{
fillintheblanks: "exercise_ifelse3.htm"
}
]
y = 8
if x > y:
print('Hello')
else:
print('Welcome')