Open main menu
python-fiddle.com
Examples
Tools
Learning
AI Data Analyst
Sign In
Examples
Tools
Learning
AI Data Analyst
Chrome Extension
Sign In
User Input
How to get user input in Python.
Share
Upload files
+ Code
+ Markdown
Python
name = input("What is your name? ") print("Hello, " + name + "!")
Click
Run
or press
shift + ENTER
to run code.
+ Code
+ Markdown
Related
Booleans
Built-in functions are pre-defined functions that are available for you to use without needing to write the code for them yourself.
Conditional statements allow us to make decisions based on certain conditions.
The continue and break statements provide control flow within loops.
A dictionary is a collection of key-value pairs.
Dictionary comprehension is a concise way to create dictionaries in Python.
f-strings make it easy to include variables or expressions directly within a string.
A for loop is a way to repeat a block of code multiple times.
A function is a block of reusable code that performs a specific task.
The import statement is used to bring in external modules or libraries into your code.
A list is a collection of items that are ordered and changeable.
List comprehension is a concise way to create lists in Python.
Python not Operator
Integers and floats are two different types of numerical data in Python.
Python or Operator
The print() function is used to display output on the screen.
The range() function is used to generate a sequence of numbers.
A set is an unordered collection of unique elements.
A string is a sequence of characters.
Python String Formatting
A tuple is similar to a list, but it is immutable, which means its values cannot be changed once it is created.
Variables are used to store values that can be used later in your code.
A while loop is used to repeatedly execute a block of code as long as a certain condition is true.