
Python Basics Quiz I

Quiz
•
Information Technology (IT)
•
10th Grade
•
Medium
Julius Gunawan
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the basic data types in Python?
string, number, boolean, object
char, list, tuple, dict
int, float, array, set
int, float, str, bool
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a variable in Python?
var variable_name = value
You declare a variable in Python by using the syntax: variable_name = value.
let variable_name = value
variable_name : value
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between a list and a tuple in Python?
Lists can contain only numbers, while tuples can contain any data type.
The main difference is that lists are mutable and tuples are immutable.
Tuples are created using square brackets, while lists use parentheses.
Lists are faster than tuples in all operations.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What control structure would you use to execute code repeatedly?
Variable
Condition
Loop
Function
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create a dictionary in Python?
You must use parentheses to create a dictionary, e.g., ('key', 'value')
Dictionaries can only be created with the list() function.
You can create a dictionary using square brackets, e.g., ['key': 'value']
You can create a dictionary in Python using curly braces, e.g., {'key': 'value'}, or using the dict() function.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the 'if' statement in Python?
To define a function in Python.
To import modules in Python.
To execute code conditionally based on a boolean expression.
To create a loop in Python.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you convert a string to an integer in Python?
Use eval(string) to evaluate the string as an expression.
Apply float(string) to convert a string to a float.
Use int(string) to convert a string to an integer.
Use str(int) to convert an integer to a string.
Create a free account and access millions of resources
Similar Resources on Wayground
17 questions
Python Programming Quiz

Quiz
•
10th Grade
10 questions
TRẮC NGHIỆM VUI PYTHON

Quiz
•
10th Grade
10 questions
Kuis Informatika kela X

Quiz
•
10th Grade - University
16 questions
CPU Quiz

Quiz
•
10th Grade
20 questions
Assesmen STS semester 2 Informatika

Quiz
•
10th Grade
10 questions
Se liga 1º trimestre 1º Ano

Quiz
•
10th Grade
15 questions
Quiz sobre el ornitorrinco y la programación

Quiz
•
8th Grade - University
15 questions
Python for loop/lists

Quiz
•
9th Grade - University
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 Information Technology (IT)
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
10 questions
Exploring Newton's Laws of Motion

Interactive video
•
6th - 10th Grade
20 questions
Cell organelles and functions

Quiz
•
10th Grade
10 questions
Colonial Grievances Against the King Quiz

Quiz
•
10th Grade
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade