
Python Basics: Constants, Variables, and More

Quiz
•
Computers
•
9th Grade
•
Medium
Martin Bishell
Used 1+ times
FREE Resource
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")`
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Типы данных Python2

Quiz
•
6th Grade - University
11 questions
Python. Умовний оператор

Quiz
•
5th - 10th Grade
10 questions
Python

Quiz
•
1st - 10th Grade
8 questions
Understanding Python Variables and Data Types

Quiz
•
9th Grade
10 questions
Python Programming

Quiz
•
7th - 9th Grade
10 questions
แบบทดสอบก่อน-หลังเรียน

Quiz
•
9th - 12th Grade
11 questions
J277 Programming - Data Types

Quiz
•
9th - 11th Grade
10 questions
SNLTG Bài 5

Quiz
•
6th - 9th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade