Assignment-basics,numbers
Assignment-basics,numbers
1. Create a variable called break and assign it a value 5. See what happens and find
out the reason behind the behavior that you see.
2. Create two variables. One to store your birth year and another one to store
current year. Now calculate your age using these two variables
3. Store your first, middle and last name in three different variables and then print
your full name using these variables
4. Answer which of these are invalid variable names:
_nation
1record
record1
record_one
record-one
record^one
continue
# Exercise Numbers
# 1. You have a football field that is 92 meter long and 48.8 meter wide. Find out
total
length=92
width=48.8
area=length*width
# Find out using python, how many dollars is the shopkeeper going to give you
back?
num_packets=9
cost_per_packet=1.49
total_cost=num_packets*cost_per_packet
money_paid=20
cash_back=money_paid-total_cost
# 3. You want to replace tiles in your bathroom which is exactly square and 5.5 feet
# is its length. If tiles cost 500 rs per square feet, how much will be the total
# cost to replace all tiles. Calculate and print the cost using python
length=5.5
cost=area*500
num=17