a) Identify the different types of following python literals and place them in correct type.
23.789 “TRUE”
1232
False
b) What are comments? Why do we use comments in Python Programming?
Explain with Example.
Answers
Answered by
0
Answer:
bhai nahi pata bsbavaajjagxjska
Answered by
1
Answer:
a) 23.789 : float
“TRUE” : string
1232 : integer
False : boolean
We can get the type of any variable or literals just by using type().
Example: print(type(17.7)), you will get <class 'float'> as an output.
b) Comments in Python:
- Programmer - coherent statements
- Describe what a block of statements mean
- Used to explain the program.
- Make program easily readable by the user.
- Comments in Python start with a # character
- When a # symbol is encountered anywhere, everything after it will be omitted till the line ends
Example:
#sum of two numbers
print(10 + 20)
Output: 30
Similar questions
World Languages,
1 month ago
English,
1 month ago
Math,
2 months ago
Math,
2 months ago
English,
9 months ago