Learn to Code via Tutorials on Repl.it!

← Back to all posts
Python Lesson!
stoporinjail (135)

Hello everyone! I have decided to make lessons for Python, right here! This might be converted into an interactive repl, depending on how it goes. This is meant for completely new people to Python.

What we will be learning

Lesson 1

  • Printing
  • Variables
  • F strings

Lesson 2

  • Multiple value variables
  • Imports: Random, time
  • Dictionaries
  • Loops
  • If, elif, else statements
  • User inputs
    I plan to have 6 topics for each lesson excluding this one.

Lesson 1:

This post will be lesson 1. I will post another in a few days for lesson 2.

Printing

In Python, the most important thing you will have to know is printing! It prints (writes) out a value.

How to:

print("value")

Example:

print("Hello world")

If you run the program, the console (black screen on the right) will say Hello world

Variables

Variables are like a box in Python. You can put things in the box, remove things in the box, and even find out what's in the box.

How to:

variable_name = "Value"

or for numbers:

variable_name = number

The number does not go into quotes.
To print out a variable:

print(variable_name)

or

print(variable_name, "Hi")

Examples:

name = "Bob"
print("Hi", name)

Output: Hi, Bob

F Strings

You can use an F string to print out variables and values more efficiently.

How to:

variable_name = "value"
print(f'your text here {variable_name}')

You must use the f before the quotes.

Example:

name = 'Bob'
print(f"Hello, {name}")

Output: Hello, Bob

Conclusion

So that was lesson 1! Have a great day! Lesson 2 will be released soon.

Other Lessons:

Other lesson links will be posted here.
Lesson 2: https://replit.com/talk/learn/Python-Tutorial-2/139771

Comments
hotnewtop
Whippingdot (659)

WHY DOES IT HAVE TO BE PYTHON

JWZ6 (660)

@Whippingdot i know right? there are way too many python tutorials

Flyingcrabs (29)

Because python is the best language in the world @Whippingdot @JWZ6

JWZ6 (660)

@Flyingcrabs ik but there are at least 50 tutorials on Python

FlaminHotValdez (694)

@Flyingcrabs that's extremely debatable about what language is best, each language has its own strong points in weak points.

html, css, js good for webdev.
C++ and c extremely fast.
Python very high level and easy to learn.

Each language has its own quirks, there is no "best" language. And even if python were the best language in the world, that doesn't justify the insane amount of tutorials about it that cover only the basics.

Flyingcrabs (29)

well to see most of my projects are well html,css and python @FlaminHotValdez

stoporinjail (135)

Personally, Python is the best because it's super easy to learn and doesn't require a lot of typing
c & C++ is too much typing
Idk about HTML, css or js but they're ok ig @FlaminHotValdez

Whippingdot (659)

bruh in C and C++ you can do more things. It is like Java, you can create games with them. Python is a growing language, and is easier to write, but you can do less complex things with it. With libraries though, you can match the things C++ and C does, but it will be slower in execution. No-one would create an OS in Python because C and C++ would be way faster, and right when you press a button, you will get instant feedback. @stoporinjail

FlaminHotValdez (694)

@stoporinjail typing isn't everything

python is extremely inefficient compared to c and c++

IntellectualGuy (825)

@FlaminHotValdez You gotta agree that python is known for ML.

FlaminHotValdez (694)

@IntellectualGuy yes, but c and c++ are still much efficient. each language has its pros and cons, there is no clear best language

Nearday (5)

@JWZ6 Yeah like literally there are so many python tutorials and it is really annoying because I already know python and I think there should be more tutorials on different languages.

JWZ6 (660)

@pythoncooluser i made one on python TURTLE

Nearday (5)

@JWZ6 Oh cool can I see it?

Nearday (5)

@JWZ6 I already know turtle in python it is really easy but it is a really good tutorial I must say.

ArchilBeraia (3)

@Whippingdot python has some features that c++ and other languages dont have. Python is much easier to start with when entering coding world. Even thought python is slow it is much understandable for begginers.

Nearday (5)

@JWZ6 I was wondering if you would answer the question that I have posted because all the other ones are not working so please go to my profile and answer the question. If you click posts, you will see the question.

alsike (13)

@JWZ6 Ha I See You, Hello

JWZ6 (660)

@alsike how did this get so popular

alsike (13)

@JWZ6 Dunno, It's Pretty Cool Tho

JWZ6 (660)

a bit too basic in my opinion @alsike

alsike (13)

@JWZ6 I Agree, Lacks Info Too, But It's Not Terrible

CatGirlMeow (1)

I'm new and this is so confusing to me. BTW I don't know anything about codes.

robottommy150 (1)

is there good ones to make a video game?

NewbieLeo (1)

print('{} good!'.format('Sounds'))

prolomic (1)

Cool and great lessons, but you can use teams/multyplayer programming to show it live!

stoporinjail (135)

Ok whoever's upvoting my repl by creating a lot of accounts, stop it.

stoporinjail (135)

@TylerGibson99, @mahinhasan, @alo0911, @rameshvottem, @TerenceLin1, @Lem0nes and a few more don't do it ok? (sorry if you didn't do it)

theangryepicbanana (1697)

@stoporinjail how do you know they're doing that?

TylerGibson99 (1)

@stoporinjail Don't see why you're @ me even though I never did that

stoporinjail (135)

@theangryepicbanana 0 repls, no chosen languages that seems kinda sus

RohilPatel (1581)

Who says they're making many accounts? They could just be people wanting to learn about python. @stoporinjail

stoporinjail (135)

@RohilPatel but most of them have 0 repls and no preferred language that's a bit sus

RohilPatel (1581)

lmao no it's not. This isn't among us. @stoporinjail

stoporinjail (135)

why are you even on replit @Eddiecro

SamiOsman (44)

@Eddiecro If you are mean do not be on replit. Don't talk trash if your jealous...admit it ;)

FlaminHotValdez (694)

ah yes, another python tutorial to add on the hundreds that are already on replit

RohilPatel (1581)

Dang now I get to learn python for the 101st time @FlaminHotValdez

JBloves27 (1887)

Heyo, pretty noice tutorial, but few suggestions:
Add all the lessons in one post, add more text or information in the tutorial.

Hope this helps!

stoporinjail (135)

@JBloves27 Good suggestion I'll try to add more stuff in each lesson

OldWizard209 (1542)

Why has this even got 10 upvotes? I am not a hater or anything, but there are like a MILLION tutorials on Python on replit already. It is more than enough to actually make someone proficient in Python. People only make Python tutorials for cycles, because it is easy to learn. Like in this tutorial, half the things are TBD, TBD. LIke please make an actual tutorial that helps people. @stoporinjail

stoporinjail (135)

@OldWizard209 As I mentioned, this is for beginners! Also, I haven't decided what to teach yet ok?

GhostKing007 (139)

I agree, python tutorials have come to the point where they're just being posted for cycles now. I rarely even look at tutorials now. (Your JS tutorial was pog tho)@OldWizard209

OldWizard209 (1542)

If you havent decided what you will teach, then why would you make a tutorial in the first place? There are already so many python tutorials @stoporinjail

RohilPatel (1581)

It's because everyone freaking likes python and that's what attracts the most viewers @OldWizard209

OldWizard209 (1542)

Yes, but there are millions of Python tutorials on replit already, why bother to make one? @RohilPatel

RohilPatel (1581)

Lemme clarify - I'm 100% agreeing with you; not much more need for py tuts @OldWizard209

MaciahLawson (32)

U wanna collab teaching people python?