Python For Beginers
๐ Python for Beginners: Mastering the print() Statement & More (Under 10 Minutes)
๐ Published: September 9, 2025 | ⏱️ Read Time: 8–10 minutes
๐ What You’ll Learn
- How to use the
print()function effectively - Printing variables and combining text
- Formatting output with f-strings
- Taking user input with
input() - Mini challenge to practice your skills
๐บ Prefer Video?
Watch this beginner-friendly Python tutorial in under 10 minutes!
๐น 1. The print() Function
The print() function displays output to the screen. It’s one of the most basic and essential tools in Python.
print("Hello, world!")
print("Welcome to Python!")
๐ก Tip:
print() ends with a new line. To print on the same line, use end=" ".
print("Hello", end=" ")
print("world!")
๐น 2. Using Variables
You can print variables to make your code more dynamic and flexible.
name = "Alice"
age = 25
print("Name:", name)
print("Age:", age)
๐น 3. f-Strings for Formatting
f-strings allow you to easily embed variables in your strings.
print(f"My name is {name} and I am {age} years old.")
๐ก Note: f-strings require Python 3.6 or later.
๐น 4. Taking Input from Users
The input() function allows user interaction.
user_name = input("What's your name? ")
print(f"Nice to meet you, {user_name}!")
⚠️ Remember:
input() always returns a string, even if the user types a number.
๐ง Mini Coding Challenge
Try this quick exercise to practice everything you’ve learned so far:
- Ask the user for their favorite color
- Ask them for their favorite food
- Print a creative sentence using both!
color = input("What's your favorite color? ")
food = input("What's your favorite food? ")
print(f"Imagine eating {food} on a {color} plate!")
✅ Summary
| Concept | You Learned |
|---|---|
| print() | How to display output |
| Variables | Store and print data |
| f-Strings | Format strings with variables |
| input() | Get data from the user |
๐ Bonus Resources
- ๐ Python Docs – print()
- ๐ Real Python – f-Strings
- ๐ W3Schools – input()
- ๐ฅ Download Python
๐ Download this tutorial as PDF
๐ฃ What’s Next?
- ๐ก If statements and logic
- ➕ Math with Python
- ๐ Working with files
๐ Want more tutorials like this? Subscribe here or bookmark this blog!
Happy coding! ๐ | Python for Beginners Series © 2025
Easy to understand and detailed
ReplyDeletebhai genuine thing
ReplyDeletetoo easy to understand in detail
SUPERB...best teaching and learning material by author step by step
ReplyDeleteBEST BLOGS EVER READ
ReplyDeleteAmazing notes and easy to understand ๐
ReplyDeleteAmazing notes and easy to understand
ReplyDeleteVety informative
ReplyDeleteExcellent content
ReplyDelete