top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Python: What is the difference between input() and raw_input() functions ?

0 votes
589 views

Both the functions are used to take user inputs but how to decide which one to use ?

posted May 7, 2017 by Vikram Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

This should be based on which version of Python you are using.
If you are using Python-2.7 then you need to give raw_input( ).
If you are using 3.6.0 then use only input().

answer May 25, 2017 by Aahan Mozumdar
0 votes

I did not use python extensively but this is very basic question so I will try to answer.

raw_input( ) returns string always but input() function does not return string. input() function does not return string means it return integers, decimal values.

answer May 8, 2017 by Ganesh
...