E-Note 16784 Content Document 20240312112644AM
E-Note 16784 Content Document 20240312112644AM
(23EN1202)
type() function.
• Whatever you enter as input, the input function converts it into a string.
• If you enter an integer value still input() function converts it into a string.
# Output
print(add)
# output
print(add)
❑Python indentation is a way of telling a Python interpreter that the group of statements belongs to a
particular block of code.
In Python, indexing syntax can be used as a substitute for the slice object.
This is an easy and convenient way to slice a string using list slicing and Array slicing
both syntax-wise and execution-wise.
A start, end, and step have the same mechanism as the slice() constructor.
2.Write a program that accepts your name and five subjects mark.
Print an output where you will see your name and five subjects mark including your average mark.
Formatted string literals (also called f-strings for short) let you include the value
of Python expressions inside a string by prefixing the string with f or F and writing
expressions as {expression}.
It works only in python version 3.6 and above.
Example:
❖ For loop
❖ Range function
❖ Booleans
❖ While loop
❖ Nested loop