-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVariable.py
More file actions
34 lines (24 loc) · 964 Bytes
/
Variable.py
File metadata and controls
34 lines (24 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Exercise: Python Variables
# 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.
# Create two variables. One to store your birth year and another one to store current year. Now calculate your age using these two variables
# Store your first, middle and last name in three different variables and then print your full name using these variables
# Answer which of these are invalid variable names: _nation 1record record1 record_one record-one record^one continue
# Q1 break = 5 #break key it doesn't used for variable name
# Q2
brith_year = 2000
current_year = 2023
my_age = current_year - brith_year
print(my_age)
# Q3
first_name = "Abdul"
second_name = "Wajid"
last_name = "Ansari"
print(first_name, second_name, last_name)
# Q4
# _nation: valid
# 1record: invalid
# record1: valid
# record_one: valid
# record-one: invalid
# record^one: invalid
# continue: invalid