Python 3 basic (input function)

Python 3 basic (input function)

Input() Function

A function is defined as a block of organized, reusable code used to perform a single, related action. Python has many built-in functions; you can also create your own. According to your choice. Python has an input function which lets you ask a user for some text input. You call this function to tell the program to stop and wait for the user to key in the data. In Python 2, you have a built-in function raw_input(), whereas in Python 3, you have input(). The program will resume once the user presses the ENTER or RETURN key. 

Lets see some example of input function of Python 3.0


Here you can see that first we have took a variable "a" in which we have taken an input . By default the input function takes the input in the string format.


And next we have taken an variable "b" in which we have taken an input as numeric value and printed it. In numeric value also whatever you will enter the input function takes it as a string.

we can check the type of whatever is taking the input function is in the string type. By the type function we can check this

so,here we can see that all the things which takes the input function takes in a string type format




You need to explicitly convert it into an integer in your code using typecasting


Recommended post: Taking Multiple Input from user in Python







if you want to learn python for free, here are the top 5 courses available who provide you free python courses 

1. Codeacademy: If you like interactive learning, then there is no better place than Codecademy.  click here to visit 

2. Udemy: like Udemy because you can virtually find a course on anything you want to learn and that too for free.  click here to visit

3.Google's python class: Google has its own excellent set of Python tutorials for beginners, known as Google's Python class. This is a free class for people with a little bit of programming experience and who want to learn Python. click here to visit

4.Microsoft's free python course: Like Google , Microsoft also has its own class for Python
     click here to visit

5. Coursera: This is the platform from where you can learn python from scrap to advance with the top leading universities.  click here to visit 











#best online course for machine learning with python
#best python training online
#free online course python data science
#best python learning course online
#best python programming 
#python for data science course free
 #machine learning using python
 #matplotlib
 #python 3
 #scikit learn
 #tkinter
 #earn python the hard way
 #python for data analysis
 #python ai
 #python training
 #python data analysis
 #best python tutorial
 #python classes near me
 #learn python for beginners
 #python online training
 #django course
 #advanced python course
 #python course fees
 #introduction to data science in python
 #free python tutorial
 #learn python basics
 #python study
 #python and ai
 #python computer science
 #learn python step by step
 #best course to learn python
 #learn python with projects
 #python artificial intelligence tutorial









Post a Comment

1 Comments

  1. Nice article.Typecasting is an important topic needed in python ,java as well as in other programming languages.

    ReplyDelete

If you have any doubt, Please let me know.