What will be the output of the following code if the user enters "Alice"? name = input("Enter your name: ") print("Hello, " + name + "!")

Python Input and Output Quiz

Quiz
•
Information Technology (IT)
•
7th Grade
•
Medium

Amira Abd El-aziz
Used 4+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Hello, name!
Hello, Alice!
Enter your name: Alice
Error
2.
MULTIPLE SELECT QUESTION
1 min • 1 pt
What is the correct way to take two numbers as input, add them, and print the sum?
a = input("Enter first number: ") b = input("Enter second number: ") print(a + b)
a = int(input("Enter first number: ")) b = int(input("Enter second number: ")) print(a + b)
a = input("Enter first number: ") b = input("Enter second number: ") print(int(a + b))
a = input("Enter first number: ") b = input("Enter second number: ") print(int(a) + int(b))
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output if the user enters 4 and 5 for the following code? x = int(input("Enter first number: ")) y = int(input("Enter second number: ")) print("Result:", x * y)
Result: 20
Result: 9
Result: 45
Error
4.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Which of the following correctly calculates the average of three numbers entered by the user?
a = int(input()) b = int(input()) c = int(input()) print(a + b + c / 3)
a = int(input()) b = int(input()) c = int(input()) print((a + b + c) / 3)
a = input() b = input() c = input() print((a + b + c) / 3)
a = input() b = input() c = input() print(a + b + c / 3)
5.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
What will be the output if the user enters 10, 2, and + in this program?
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
op = input("Enter an operation (+, -, *, /): ")
if op == "+":
print(a + b)
elif op == "-":
print(a - b)
elif op == "*":
print(a * b)
elif op == "/":
print(a / b)
else:
print("Invalid operation")
12
102
error
invalid operation
6.
MULTIPLE CHOICE QUESTION
5 sec • 1 pt
Which of the following correctly calculates the average of three numbers entered by the user?
a = int(input())
b = int(input())
c = int(input())
print(a + b + c / 3)
a = int(input())
b = int(input())
c = int(input())
print((a + b + c) / 3)
a = input()
b = input()
c = input()
print((a + b + c) / 3)
a = input()
b = input()
c = input()
print(a + b + c / 3)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output if the user enters 4 and 5 for the following code?
python
x = int(input("Enter first number: "))
y = int(input("Enter second number: "))
print("Result:", x * y)
20
9
45
error
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code if the user enters "Alice"?
python
name = input("Enter your name: ")
print("Hello, " + name + "!")
A. Hello, name!
B. Hello, Alice!
C. Enter your name: Alice
D. Error
Similar Resources on Quizizz
6 questions
CA - Python 04 - Ввод/Вывод информации

Quiz
•
7th Grade
10 questions
Основи Python

Quiz
•
7th Grade
10 questions
Вікторина "БАЗОВІ ЗНАННЯ"

Quiz
•
7th Grade
10 questions
Ch2變數與運算式-綜合演練選擇題

Quiz
•
6th - 8th Grade
7 questions
Lekcja 1.3

Quiz
•
4th Grade - University
10 questions
Арифметика чисел

Quiz
•
7th Grade
10 questions
Викторина по языку Python

Quiz
•
6th - 8th Grade
10 questions
“Elektron pochtada ishlashni boshlash” (5-sinf))

Quiz
•
5th Grade - University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
11 questions
Decimal/fraction conversions quick check

Quiz
•
5th - 7th Grade
10 questions
Identifying equations

Quiz
•
KG - University
44 questions
El fin del año- 7th

Quiz
•
7th - 12th Grade
20 questions
Math Review

Quiz
•
7th Grade
14 questions
Subtracting Integers

Lesson
•
6th - 8th Grade
15 questions
Exponent Properties

Quiz
•
7th - 9th Grade