
Python Basics: Constants, Variables, and More
Authored by Martin Bishell
Computers
9th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to define a constant in Python?
`const PI = 3.14`
`PI = 3.14`
`constant(PI) = 3.14`
`#define PI 3.14`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to declare a variable `x` with the value `10` in Python?
`int x = 10`
`x := 10`
`x = 10`
`var x = 10`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is used to print a message in Python?
`print("Hello, World!")`
`echo "Hello, World!"`
`System.out.println("Hello, World!")`
`printf("Hello, World!")`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following data types does not exist in Python?
`list`
`tuple`
`array`
`set`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you concatenate two strings, `a` and `b`, in Python?
`a + b`
`a.concat(b)`
`concat(a, b)`
`a & b`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? `print("Python"[1:3])`
`Pyt`
`yth`
`yt`
`tho`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to convert the string `"123"` to an integer in Python?
`int("123")`
`parseInt("123")`
`"123".toInt()`
`convert.toInt("123")`
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
15 questions
CIW
Quiz
•
9th - 12th Grade
10 questions
Word basics
Quiz
•
8th - 12th Grade
10 questions
Online Databases vs. Search Engines
Quiz
•
6th - 10th Grade
10 questions
Microsoft Publisher
Quiz
•
7th - 10th Grade
10 questions
Internet
Quiz
•
7th - 10th Grade
10 questions
python-BTxâu
Quiz
•
9th - 12th Grade
10 questions
Logic Gates
Quiz
•
9th - 12th Grade
10 questions
AI and Python: Ch.1 Revision
Quiz
•
9th 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