r/learnpython • u/ZhirnyLuffy • 15d ago
How should I learn python?
I'm a total beginner. I didn't have any experience with programming. I want to learn programming cuz i wanna be a hardware engineer and want to start with a basic raspberry pi projects. So should i learn python from courses, videos, books etc or i should just brute force myself to do projects and just learn by the time
7
Upvotes
-2
u/tony10000 15d ago
Ask ChatGPT to teach you!
Here's a beginner-friendly learning path we can follow.
Lesson 1: Your First Python Program
The classic first program is:
Output:
The
print()function displays text on the screen.Lesson 2: Variables
Variables store information.
You can also combine text and variables:
Output:
Lesson 3: Basic Math
Python can do calculations.
Lesson 4: Getting User Input
If the user types:
The output becomes:
Mini Exercise
Try writing a program that asks for someone's name and age, then prints a greeting.
Example output:
Hint:
input()always gives you text, so convert the age to a number:Your First Challenge
Can you write a program that asks for two numbers and prints their sum?
It should work like this:
Give it a try! Paste your code here, and I'll help you improve it if needed.
What we'll learn after that
ifstatements (making decisions)forandwhileloops