Input From User
Nerd Cafe
1. What is User Input in Python?
input("Prompt message")Practical Note:
2. Basic Example
name = input("What is your name? ")
print("Hello,", name)Output:
What is your name? Mr Nerd
Hello, Mr Nerd3. Input with Conversion: Numbers
Integers
Practical Note:
Float (Decimal)
4. Multiple Inputs in One Line
Example:
Output:
Practical Note:
5. List Input for ML or Data Science
Output:
Machine Learning Insight:
7. Advanced Tip: Loop Until Valid Input
Summary Table
Purpose
Code Example
Notes
Keywords
Last updated