Accepting Input (input()) :-
input() Python का एक Built-in Function है, जिसका उपयोग User से Keyboard के माध्यम से Input (डेटा) प्राप्त करने के लिए किया जाता है।
input() Function हमेशा String (str) प्रकार का Data Return करता है, चाहे User Number, Decimal Number या कोई अन्य Value ही क्यों न दर्ज करे।
variable_name = input("Message")
यदि input() के साथ int(), float() या किसी अन्य Type Conversion Function का उपयोग किया जाता है, तो पहले input() String (str) Return करता है, उसके बाद Type Conversion Function उस String को आवश्यक Data Type में Convert (परिवर्तित) कर देता है।
age = int(input("Enter your age:"))
English:
input() is a built-in Python function used to accept input (data) from the user through the keyboard.
Syntax -
variable_name = input("Message")
Example 1: Accepting Name -
Input
Rahul
Output
Name: Rahul
Example 2: Accepting Age -
Input
18
Output-
Example 3: Integer Input -
Input
18
Output
Example 4: Float Input -
Input
99.5
Output-