
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
13 questions
Python Module 1

Quiz
•
University - Professi...
9 questions
Python training series quiz

Quiz
•
Professional Development
10 questions
INTRODUCTION TO PYTHON

Quiz
•
Professional Development
10 questions
Strings quiz

Quiz
•
Professional Development
14 questions
PyGames Workshop quiz

Quiz
•
Professional Development
10 questions
Introducción a Python

Quiz
•
Professional Development
5 questions
🇮🇩 Iteration I

Quiz
•
Professional Development
14 questions
AES: Coding Fundamentals Lessons 1 and 2

Quiz
•
7th Grade - Professio...
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
15 questions
Fun Random Trivia

Quiz
•
Professional Development
22 questions
Anne Bradstreet 1612-1672

Quiz
•
Professional Development
18 questions
Spanish Speaking Countries and Capitals

Quiz
•
KG - Professional Dev...
14 questions
Fall Trivia

Quiz
•
11th Grade - Professi...
15 questions
Disney Characters Quiz

Quiz
•
Professional Development
15 questions
Quiz to Highlight Q types & other great features in Wayground

Quiz
•
Professional Development