
python - ML1

Quiz
•
Computers
•
Professional Development
•
Medium
Niranjani V
Used 1+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the "input()" function in Python?
To print output on the console
To receive user input from the console
To convert strings to integers
To define new variables
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to prompt the user for input and store it in a variable called "name"?
a) input("Enter your name: ")
b) input("name")
c) name = input(0)
d) name = input("Enter your name: ")
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the "print()" function do in Python?
a) It receives user input from the console.
b) It converts strings to integers.
c) It displays output on the console.
d) It defines new variables.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is used to assign a value to a variable in Python?
a) store
b) var
c) val
d) =
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
message = "Hello, World!"
print(message[7:])
a) "World!"
b) "Hello"
c) "Hello, "
d) "World"
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the type of the variable "num" after executing the following code?
num = input("Enter a number: ")
a) integer
b) string
c) float
d) boolean
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
x = 10
y = "5"
print(x + int(y))
a) 15
b) "105"
c) "15"
d) Error
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to concatenate two strings in Python?
a) str1 + str2
b) str1 .concat(str2)
c) concat(str1, str2)
d) join(str1, str2)
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you convert a string to all uppercase letters in Python?
a) str.uppercase()
b) str.to_upper()
c) str.upper()
d) str.case_upper()
Similar Resources on Wayground
10 questions
C Programming Quiz 2

Quiz
•
Professional Development
12 questions
python loop practice

Quiz
•
Professional Development
10 questions
7 A класс

Quiz
•
Professional Development
10 questions
T&P Test on MCQs

Quiz
•
Professional Development
10 questions
Sw Development

Quiz
•
Professional Development
7 questions
Demo Quiz Ashv

Quiz
•
Professional Development
12 questions
Neural Networks Basic with Python

Quiz
•
University - Professi...
10 questions
Python Session 5

Quiz
•
Professional Development
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade