fruits = ['apple', 'orange', 'cherry']
lst = ['apple' for x in fruits]
What will be the value of lst?
Python Test 1
Quiz
•
Computers
•
University
•
Medium
Peter Parfenov
Used 5+ times
FREE Resource
27 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
fruits = ['apple', 'orange', 'cherry']
lst = ['apple' for x in fruits]
What will be the value of lst?
['apple', 'apple', 'apple']
['apple']
True
False
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
fruits = ['apple', 'banana', 'cherry']
What is a correct syntax for looping through the fruits?
print(x) for x in fruits
for x in fruits print(x)
[print(x) for x in fruits]
3.
FILL IN THE BLANK QUESTION
1 min • 1 pt
Insert the missing part (___) of the while loop below:
4.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What will be the result of the following syntax:
x = 8
x += 2
print(x)
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
The statement below would print a Boolean value, which one?
print(bool("letter"))
6.
FILL IN THE BLANK QUESTION
1 min • 1 pt
The statement below would print a Boolean value, which one?
print(10 == 9)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the result of the following syntax:
print(5 > 3)?
True
False
5 > 3
30 questions
Javascript Quiz
Quiz
•
University
25 questions
C PROGRAMMING
Quiz
•
University
23 questions
Java
Quiz
•
University
25 questions
Java Test Basic
Quiz
•
University
25 questions
Iedc Coders Club Programming Quiz
Quiz
•
University
25 questions
Python Basics
Quiz
•
University
26 questions
R Quiz
Quiz
•
University
25 questions
Script_programming_test
Quiz
•
University
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