Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions Basics/Exercise/2_variables/2_variables_exercise.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
### Exercise: Python Variables
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:
A) gives the syntax error .because we cant an inbuilt keyword as an variable
3. Create two variables. One to store your birth year and another one to store current year. Now calculate your age using these two variables
A)
a = 2021
b = 2001
print(" ur age is {}".format(a-b))
5. Store your first, middle and last name in three different variables and then print your full name using these variables
A)
a="kuruva "
b = "diwakar "
c = "babu"
print(a+b+c)
7. Answer which of these are invalid variable names:
_nation
1record
record1
record_one
record-one
record^one
continue
A) record-one
record^one
continue

[Solution](https://github.com/codebasics/py/blob/master/Basics/Exercise/2_variables/2_variables_exercise.ipynb)
[Solution](https://github.com/codebasics/py/blob/master/Basics/Exercise/2_variables/2_variables_exercise.ipynb)