Python- Input function
Good Morning Boys.
Welcome to the fourth session of the online classes for Python Programing.
------------------------------------------------------------------------------------------------------------------------------
By the end of this session, you will be able to understand
Lets see whether the following terms are clear to you or not ?
1. Identifier
2. Comment
Welcome to the fourth session of the online classes for Python Programing.
------------------------------------------------------------------------------------------------------------------------------
By the end of this session, you will be able to understand
- the purpose and syntax of the input( ) function
- working of the input( ) function
- Understand and apply the concept of TYPECASTING.
Lets see whether the following terms are clear to you or not ?
1. Identifier
2. Comment
- inline comment
- multiline comment
Doubts if any, must be shared now. I am waiting.🙏
_______________________________________________________________
Having revised yesterday's content. Lets move ahead.
The topic of the discussion today is the INPUT function in PYTHON- input( )
Taking input in Python
Developers often have a need to interact with users, either to get data or to provide some sort of result. Most programs today use a dialog box as a way of asking the user to provide some type of input. While Python provides us with two inbuilt functions to read the input from the keyboard.
- raw_input ( prompt )
- input ( prompt )
We will limit our discussion to INPUT( )
Syntax
input(prompt)
Parameter Values
| Parameter | Description |
|---|---|
| prompt | A String, representing a default message before the input. |
More Examples
Example
Use the prompt parameter to write a message before the input:
x = input('Enter your name:')
print('Hello, ' + x)
If the user enters "Geeta" as the name, the OUTPUT will be:
Enter your name:
Hello, Geeta

Good Morning boys. Hope all is well. I want to take doubts of previous sessions. Kindly share.
ReplyDeletegood morning mam
ReplyDelete-Ashish
Good morning mam
ReplyDeleteAre there any doubts with the previous sessions?
ReplyDeleteNo mam not till now
DeleteGood morning ma'am
ReplyDelete-Geet
by the end of today's session, I want all of you to give the value for x in the following input statement:
ReplyDeletea=input("Enter a number ") #suppose user enters 5.0
b=input("Enter a number ") #suppose user enters 2.0
x=int(a/b)
print(x)
If anyone having problem, can we connect on Zoom call?
ReplyDeletepls mark your attendance as you enter the class
ReplyDeletegood morning ma'am
ReplyDelete-Artham
Ma'am, do we have to start writing from the topic SYNTAX??
ReplyDelete-Geet
Taking Input in Python
DeleteRemember, all notes to be taken down in the CA registers
ReplyDeleteGood Morning Mam
ReplyDeleteThank you ma'am
ReplyDelete-Geet
My blog is available beyond class hours also. You can take a review whenever you want and ensure you are able to understand the topic.Queries can be posted later also
ReplyDeleteI have posted a question in the comment section. I expect an answer for that after you have concluded the topic. I am waiting
ReplyDeletema'am, the value of x is 2.5
Delete-Geet
mam the value of x is 2
ReplyDeletethanks. I will share the answer when others also have shared their answer
Deleteok mam
DeleteMa'am i've finished my work
ReplyDelete-Geet
I expected you to answer the question given
Deletema'am, the value of x is 2.5
ReplyDeletePls note that a=5.0 and b=2.0 . on division the result will be 2.5 but \because of typecasting (int(a/b)), 2.5 which is float will be typecasted to integer, that is 2
ReplyDeleteSo the answer is 2
Ok ma'am
DeleteI hope you have understood the explanation.
ReplyDeleteGood morning mam
ReplyDeleteBrian