Practice Creating and Using Variables - 1.4 | Variables and Data Types | Python Programming Language
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Creating and Using Variables

1.4 - Creating and Using Variables

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

Declare a variable color and assign it the value 'Red'. What is the type of this variable?

💡 Hint: Remember to check using `type()` function.

Question 2 Easy

Create an integer variable year and assign it the value 2021.

💡 Hint: Use a number without quotes.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What is the syntax to create a variable in Python?

variable = value
value = variable

💡 Hint: Think about the direction of the assignment.

Question 2

True or False: A variable name can start with a number.

True
False

💡 Hint: Recall the naming rules we discussed.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a Python program that accepts user input for their name and age, and then uses string interpolation to print out a greeting that includes both.

💡 Hint: Use proper variable assignment and print formatting.

Challenge 2 Hard

Create a program that takes a numeric string input, converts it to an int, adds 10, and prints the result.

💡 Hint: Remember to first convert the string and then perform the addition.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.