Before starting with Python Variables, let’s look into the different mathematical operations you can do in Python.
Python is not strictly typed language , so you don’t need declare the type of the variable and then use.You can straightway assign the values of variables and python will understand the type of the variables. Below are types of variables –
- Numbers
- String
- List
- Tuple
- Dictionary
Category: Python
In the first example, Since there is a print(my_list) after defining the list, shouldn’t the correct output be:
3
[‘Hello’, ‘Denken’, ‘3’]
[[‘Hello’, ‘Denken’, ‘3’], [1, 2, 3]]
2
[‘Hello’, ‘Denken’, ‘3’]
[1, 2, 3]
Hello
print(type(my_list))
o/p – class ‘list’
print(len(my_list))
o/p – 3
print(my_list)
o/p – [‘Hello’, ‘Denken’, ‘3’]
hope you can understand now.