HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClassesGroups

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Blog

Account

  • Dashboard
  • My Content
  • Profile
  • Log in
© 2026 senLearn. All rights reserved.HelpAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /Python Basics
  3. /Variables and Data Types

Variables and Data Types

Python Programming
+ Upload a Problem
More in Python BasicsGetting Started with PythonVariables and Data TypesOperators and ExpressionsInput and OutputStringsConditionals: if, elif, elseLoopsListsFunctionsMini Projects
14 problems
Type:
1.
Each of these three programs stops with an error.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Easy
2.
Say what the type of each result is, and what value it has. Decide on paper first.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Medium
3.
A student wants to swap a and b, and writes…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Easy
4.
Trace the program
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Medium
5.
score = 10 and then Score = 99. What does print(score, Score) show? Are these the same variable?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Easy
6.
Each name below is wrong. Say why, and write a correct name.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Medium
7.
What do these lines show? print(5 > 3), print(2 == 3), print("a" == "a"), print(type(5 > 3)).
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Medium
8.
age_text = "12" and age_number = 12. What is the difference?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Medium
9.
a = 3 and b = 8. Write code that swaps them, so that a is 8 and b is 3.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Medium
10.
A game score starts at 0. The player gets 10 points, then 5 points, and then the score is doubled.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Easy
11.
Follow the values
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Medium
12.
Give the type (int, float, str or bool) of each value: 7, 7.0, "7", True, 3 > 2.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Easy
13.
Which of these are valid variable names?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Easy
14.
Store your name, your age and your city in three variables.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Variables and Data TypesStemPy LabStemPy Lab
Easy