Flash Sale: Flat 70% + Addl. 25% Off on all Courses | Use Coupon DS25 in Checkout | Offer Expires InEnroll Now
In the previous exercise, we have seen Python is a great calculator. In real-life when we write code, we use variables to define values so that we can reuse them again and again in our code.
A variable is a name that refers to a value. Let's see some examples.
my_name = "John" age = 28 pi = 3.14
John is a string which is assigned to
my_name variable. Similarly
28 is a number which is assigned to variable
pi is assigned the value of
Pro Tip -
= is an assignment operator in Python. You can assign a value to a variable using
To print the value of a variable, we use
pi, simply type below statement into a Jupyter notebook on the right-hand side and execute the cells.
Use Jupyter notebook on the right-hand side to write code and complete this exercise
bank_balancewith the value
bank_balance. It should print
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here