Practice Exercise - 1.10 | Variables and Data Types | Python Programming Language
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Academics
Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Professional Courses
Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skillsβ€”perfect for learners of all ages.

games

Practice Questions

Test your understanding with targeted questions related to the topic.

Question 1

Easy

Declare a variable color and assign it a favorite color.

πŸ’‘ Hint: Use the format variable_name = value.

Question 2

Easy

What type of data does age = 30 hold?

πŸ’‘ Hint: Think about whether it's whole or decimal.

Practice 4 more questions and get performance evaluation

Interactive Quizzes

Engage in quick quizzes to reinforce what you've learned and check your comprehension.

Question 1

What is the purpose of the type() function?

  • To get the value of a variable
  • To check variable type
  • To combine variables

πŸ’‘ Hint: Think about what you would want to check about a variable.

Question 2

True or False: Variable names can start with a number.

  • True
  • False

πŸ’‘ Hint: Recall the naming rules for variables.

Solve and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

You have data collected from a survey where ages are accidentally stored as strings. Write a function that takes a list of ages as strings and returns a new list with the ages converted to integers.

πŸ’‘ Hint: Consider using list comprehension for efficient conversion.

Question 2

Create a Python program that takes input for two users' names and favorite numbers. Swap the values, then print out the new values along with their types.

πŸ’‘ Hint: Don’t forget to capture inputs as strings and then convert them as necessary.

Challenge and get performance evaluation