
2. Variables and Data Types

Quiz
•
Education
•
5th Grade
•
Easy
Robotic Schools
Used 132+ 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
20 questions
Barcode

Quiz
•
1st - 10th Grade
24 questions
SOAL RPL

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

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

Quiz
•
5th Grade
15 questions
RBT F3

Quiz
•
1st Grade - Professio...
15 questions
Scratch Programming Level-2 Final Exam

Quiz
•
5th - 8th Grade
15 questions
Senses and Nervous System Quiz

Quiz
•
5th Grade
20 questions
REVISION 4 : TOPIC 3, 4, 5 & 7

Quiz
•
1st Grade - University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade