
2. Variables and Data Types

Quiz
•
Education
•
5th Grade
•
Easy
Robotic Schools
Used 145+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
📚 Sarah is buying 5 books on an e-commerce website. She stores the number of books in a variable. Which of the following is the correct way to declare this variable in Python? 🐍
int books = 5
books = 5
declare books = 5
variable books = 5
2.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
What is the primary purpose of comments in code? 💬
To make the code run faster ⚡
To prevent certain code from executing 🚫
To explain the code and make it more readable 📖
To declare variables 📝
3.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
💪 A user enters their weight in kilograms on a fitness app. If user_weight = 70.5, what will the data type of user_weight be? 🐍
int
float
str
bool
4.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
🎮 John is naming a variable to store his score. Which of the following is NOT a valid variable name in Python?
playerScore
score_1
1score
gameScore
5.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
🏦 In a bank transaction system, if a user tries to add a string and an integer, like in the code below, what will happen?
600
"500100"
Error
None of the above
6.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
📱 A user inputs their phone number into a website form as a string. How can you convert to a string in Python? 🤔
str(1234567890)
convert(1234567890)
str.int(1234567890)
string(1234567890)
7.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
💳 In an online payment system, if amount = 100 and currency = "USD", what will be the result of amount + int(currency)? 🤔
USD100
100USD
Error
None of the above
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Scratch Programming Level-2 Final Exam

Quiz
•
5th - 8th Grade
20 questions
Cyber Security Month 2019

Quiz
•
KG - Professional Dev...
15 questions
Basic of Sketching using Fusion360

Quiz
•
3rd - 12th Grade
20 questions
Quizz Toastmasters - JPOT

Quiz
•
1st - 12th Grade
21 questions
review of concepts -Module 2 (PM, sustainability and CSR)

Quiz
•
1st - 5th Grade
15 questions
python operator

Quiz
•
5th Grade
15 questions
Тест-Пайтон

Quiz
•
5th Grade
20 questions
Year 5 Team Freeze Tag - VEX IQ

Quiz
•
5th 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