Python Knowledge Check
Quiz
•
Computers
•
Professional Development
•
Medium
Ga-Yen Dang
Used 3+ times
FREE Resource
Enhance your content in a minute
35 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the main version of Python currently supported?
Python 1
Python 2
Python 3
Answer explanation
The currently supported version of Python is Python 3.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What Python function is used to display information on the screen?
len
open
Answer explanation
len() = Returns the length of an object.
E.g. If the object is a string, len() will return the number of characters in the string.
If the object is a list, len() will return the number of items in the list.
print() = Displays the information on the screen.
open() = Opens a file and returns a file object.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What file extension is typically used for Python files?
python
p
py
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
To show a string on the console, what code would you enter?
print(my message)
println("my message")
print("my message")
Answer explanation
Use the print function with double quotation marks to show strings.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
If you invoke a program with program.py 1 2, what does the code sys.argv[0] contain?
It contains the program.py, the name of the program
It contains 1, the first command-line argument.
It contains 2, the second command-line argument.
Answer explanation
Position 0 (in sys.argv[0] is always the name of the program.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will happen if you run the statement "1" + 2 ?
It will evaluate to 3.
It will give an error.
It will become "12".
Answer explanation
It will show the error message "can only concatenate str (not "int") to str".
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Under what conditions does a test expression that uses the and operator evaluate to True?
A test expression that uses the and operator evaluates to True when both subexpressions are true.
A test expression that uses the and operator evaluates to True when one subexpression is true and the other is false.
A test expression that uses the and operator evaluates to True when both subexpressions are false.
Answer explanation
Both conditions in the test expression must be true for the entire test expression to evaluate to true.
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
40 questions
Computer Networking Midterm
Quiz
•
Professional Development
38 questions
Итоговый тест по Python Middle
Quiz
•
Professional Development
30 questions
ICDL/ECDL COMPUTER ESSENTIALS - QUIZ #2
Quiz
•
Professional Development
30 questions
Elements of Art and Principles of Design - Quiz 1
Quiz
•
10th Grade - Professi...
40 questions
CYBER SECURITY
Quiz
•
Professional Development
35 questions
Cyber Security
Quiz
•
Professional Development
30 questions
IT support L1 Q-3
Quiz
•
Professional Development
39 questions
Lvl 1 Introduction DBMS (QB)
Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
Discover more resources for Computers
10 questions
Identifying Phishing Emails Quiz
Quiz
•
Professional Development
14 questions
2019 Logos
Quiz
•
Professional Development
7 questions
Tone and Mood Quick Check
Quiz
•
Professional Development
32 questions
Abbreviations and Equivalents
Lesson
•
6th Grade - Professio...
5 questions
11.4.25 Student Engagement & Discourse
Lesson
•
Professional Development
