10000 exercise solutions for python variables · KDvs123/python-tutorials@93f52c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 93f52c4

Browse files
committed
exercise solutions for python variables
1 parent c4897de commit 93f
8000
52c4

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

python variables/exercise1.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#Create a variable called break and
2+
# assign it a value 5.
3+
# See what happens and find out the reason
4+
# behind the behavior that you see.
5+
6+
number=5
7+
print(number)

python variables/exercise2.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#Create two variables.
2+
# One to store your birth year and
3+
# another one to store current year.
4+
# Now calculate your age using these two variables
5+
6+
birth_year=2001
7+
current_year=2024
8+
9+
age=current_year-birth_year
10+
print(age)

python variables/exercise3.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Store your first, middle and last name
2+
# in three different variables and then
3+
# print your full name using these variables
4+
5+
first_name="Vihanga"
6+
middle_name="Supasan"
7+
last_name="Kariyakaranage"
8+
9+
print(first_name+" "+middle_name+" "+last_name)

0 commit comments

Comments
 (0)
0