
Python Mod 2 Sec 6
Authored by Susan Fudge
Information Technology (IT)
11th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the print() function do?
Sends data to the console
Gets data from the console
Stops the program flow
Concatenates strings
Answer explanation
The print() function sends data to the console, allowing users to see output from their programs. This is essential for debugging and displaying information, making it the correct choice among the options.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the input() function?
Sends data to the console
Gets data from the console
Stops the program flow
Concatenates strings
Answer explanation
The input() function is used to get data from the console, allowing users to enter information during program execution. This makes 'Gets data from the console' the correct choice among the options provided.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Fill in the blank: The input() function comes with an optional parameter: the ________ string.
prompt
output
input
default
Answer explanation
The input() function in Python has an optional parameter called 'prompt', which allows you to specify a string that will be displayed to the user before input is taken. This helps guide the user on what to enter.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Fill in the blank: The result of the input() function is a ________.
string
integer
list
boolean
Answer explanation
The input() function in Python always returns user input as a string, regardless of what the user types. Therefore, the correct answer is 'string'.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain how string replication works in programming using the example provided: my_input = input("Enter something: ") # Example input: hello print(my_input * 3) # Expected output: hellohellohello
String replication repeats the string a specified number of times.
String replication reverses the string.
String replication converts the string to uppercase.
String replication adds a newline after each character.
Answer explanation
String replication in programming allows a string to be repeated a specified number of times. In the example, 'hello' is printed three times as 'hellohellohello', demonstrating this concept.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these is the correct way to print "parsley, sage, rosemary, and thyme"?
print parsley, sage, rosemary, and thyme
print "parsley, sage, rosemary, and thyme"
print("parsley, sage, rosemary, and thyme")
print[parsley, sage, rosemary, and thyme]
Answer explanation
The correct way to print a string in Python is using parentheses. Thus, 'print("parsley, sage, rosemary, and thyme")' is correct. The other options either lack quotes or use incorrect syntax.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
6 questions
PRETEST KJD
Quiz
•
9th - 12th Grade
5 questions
Post Test Konsep Dasar Basis Data
Quiz
•
11th Grade
5 questions
Pre-test Percabangan
Quiz
•
10th Grade - University
10 questions
Questões de SQL
Quiz
•
11th Grade
10 questions
Informatika2
Quiz
•
11th Grade
10 questions
Logical Reasoning & Learning to Code
Quiz
•
11th Grade
10 questions
POSTEST INFORMATIKA
Quiz
•
9th Grade - University
11 questions
C++ Moxillón
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
15 questions
Main Idea and Supporting Details.
Quiz
•
4th - 11th Grade
12 questions
Add and Subtract Polynomials
Quiz
•
9th - 12th Grade
13 questions
Model Exponential Growth and Decay Scenarios
Quiz
•
9th - 12th Grade
27 questions
7.2.3 Quadrilateral Properties
Quiz
•
9th - 12th Grade
7 questions
Amoeba Sisters Dihybrid Cross Punnett Square
Interactive video
•
9th - 12th Grade
10 questions
The Holocaust: Historical Overview
Interactive video
•
9th - 12th Grade
10 questions
Key Features of Quadratic Functions
Interactive video
•
8th - 12th Grade