Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
206

PYTHON TUTORIAL

TheRealSnowSJ
TheRealSnowSJ

Comparison -

FeaureInteractive OnlineNon-Int OnlinePDFJupyter
Readable ContentYesYesYesYes
Input your own codeYesNoNoYes (Your code will not be validated)
Run code snippets used in the tutorialNoNoNoYes
Open source codeYesYesYesYes

These links are powered by SJURL , my personal URL Shortener. If these links do not seem to be working, click here and make sure it says Up. If not, ping me below and I'll try to figure out why my site isn't up.

Yay my first post that came onto the 'hot' section of Repl Talk!
omg yay this is beyond expectations, 130 upvotes! Can we get to 140?

Please make sure you are signed into repl.it or else it gives an error

The Easy Way to Learn Python

With this easy to use Python tutorial, you can learn python the easy way

This Python tutorial covers -

  • IDE Comparison (Level0)
  • Your first hello world! (Level1, Print)
  • String vs. Int vs. Float (Level2)
  • Variables (Level3)
  • Conditionals, with if, elif, and else (Level4)
  • User Inputs (Level5)
  • Lists (Level6)
  • Functions (Level7)
  • 2D Lists (Level 8)
  • Loops (Level 9 & 10)
  • Dictionaries (Level 11)
  • Common Modules (Level 12)

Coming Up

I plan to add the following topics later on

Also Supports -

  • ACCOUNTS
    • These accounts are secure, and only you can access your password. Only you can delete your account, and only you can login with it.

EDIT: I investigated a bit with the account system, and if u don't have a repl.it account/aren't signed in when using this, then ur account may be deleted if ur browser cookies/cache are cleared.

  • Accounts help save your progress so you don't have to redo hours of tutorial again.
  • **Different colors to differentiate tutorial and code. **
    • In this tutorial, all text isn't white; And if you get deeper inside, you'll learn how to color your text too!
  • Opportunities for you to try out the code you're learning!
    • Throughout the tutorial, you will get Opportunities to type some code, and have it verified by the PythonTutorBot.

Contributing

While I cannot allow anyone to directly edit my tutorial, you can contribute by making a pull request on the GitHub Repo. (Find it here)

Updates

LISTS GOT ADDED!

Functions are here!

Welcome, 2D Lists!

Loops just got added!

Dictionaries are here

The manual level picker now also shows what each level has, instead of just the number.

Common Modules

Bonus lesson, level0, ide comparison, added

Tell me if you have more you would like to see!
Try it out here
Btw I made this whole thing in 3 days

Note: This whole tutorial was built on my favorite IDE, repl.it

Update:
A while back, I finally set up my own URL shortener with tracking statistics and changed the link to my shortened one, and the results were amazing! The link got 14 views in an hour alone! thanks for your support everyone!

Link Clicks so far - 592 πŸ‘€
EDIT: I obviously have a lot more clicks, but i'm not going to be editing this as frequently.

2 years ago

Voters

Comments

TopNew
11
TheRealSnowSJ
TheRealSnowSJ

Reply to this thread if you want to be notified for new updates.

2 years ago
2
Leroy01010
Leroy01010

me

@CoolCoderSJ

2 years ago
2
TheRealSnowSJ
TheRealSnowSJ

@Leroy01010
okie
I plan to add at least another level by today or tomorrow

2 years ago
2
TheRealSnowSJ
TheRealSnowSJ

@Leroy01010
Lists have been added! Check out level 6 for lists.

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Leroy01010
I do be cranking out levels....
Functions have been added! (level 7)

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Leroy01010
i feel like im on fire...
2d lists are here! (level 8)

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Leroy01010
common modules level 12

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@supcoolak
who.... are u.....? or did u mean that u just want to be pinged?

2 years ago
1
supcoolak
supcoolak

@CoolCoderSJ
Yeah, I wanted to be pinged.

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@supcoolak
@Leroy01010
Bonus Lesson
IDE Comparison
Level 0
Added

2 years ago
4
TheRealSnowSJ
TheRealSnowSJ

@supcoolak
@Leroy01010

by the way, the PDF version is here!
(I also added these cause a lot of people wanted it but didn't have repl.it accounts)

View non interactive online here
View Downloadable PDF here

2 years ago
1
supcoolak
supcoolak

@CoolCoderSJ
This is so cool! (Totally didn't send this to a friend struggling to start learning Python). I wanted to say something about Atom, you can run code in Atom if you install the script package.

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@supcoolak
wait really? thanks! (for both points)

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@supcoolak
@Leroy01010
.ipynb version made, (hosted on Google Colab)
Find it here
This adds support for running code snippets throughout the tutorial and seeing live results

2 years ago
1
supcoolak
supcoolak

@CoolCoderSJ
Hey! Came here to say thank you! My friend (the one I recommended this to) and I are now making a game using pygame because of you!

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@supcoolak
yay, that's great!
pygame is awesome, hope you guys have fun!

2 years ago
4
Bookie0
Bookie0

Pretty nice, some tips:

The first thing to note is that there are no semicolons unlike other languages

wdym unlike other languages? not all languages have semicolens

maybe it's me, but perhaps add a space between the ] and the text? And perhaps a > or something to prompt the user?
Screen Shot 2020-12-19 at 3.03.06 PM

And when I create an account, there's text but I don't get to see it as it shows for like 1 sec then disappears...

The 'Print' Statement

print doesn't have a capital P

As a note, please use single quotes, NOT double quotes.

both can be used, you should be able to accept both lol

print('Hello World')

Hello World! has an exclamation mark!

this should work, it gives the same output as what you wrote
Screen Shot 2020-12-19 at 3.08.15 PM

'hullo' . Please use single quotes. Define it below

again, you don't need single quotes lol you can use double quotes.

Anyways, the rest is pretty fine! :)

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
hmm
thanks for ur feedback

  1. I do agree, I think I should add a >
  2. Yeah lol sorry I hate js ill change that
  3. Yeah hmm I changed that later on, I must have forgotten to accept both in the earlier levels
  4. I didn't know that, ill add an exclamation mark
  5. U have a space between print and (

I don't think python accepts spaces

Thanks for ur feedback!

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
again, thanks for the feedback, i did change a couple of things, especially the double quotes and signup message timeout.

Btw it was supposed to tell u this after signing up
"Great! Your username is "+username+" and your password is "+password+" Don't worry, only you can access these passwords and usernames, and all data is encrypted. You're going to be redirected to the main page now, Login with your new credentials to get started."

2 years ago
1
Bookie0
Bookie0

@CoolCoderSJ

ok
ok
ok
ok
uhhhhhhhhh
python does accept spaces lol if you didn't know that...
Screen Shot 2020-12-19 at 8.53.02 PM

you can also put a lot of space:

Screen Shot 2020-12-19 at 8.53.21 PM

np! :D

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
whoa cool I didn’t know that....

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
all right i did have to break yesterday, but as of now, it accepts spaces between print and (.

2 years ago
1
Bookie0
Bookie0

@CoolCoderSJ

Screen Shot 2020-12-20 at 12.23.52 PM

this normal? pretty bright lol

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
whoa uh u must have some external script running

This is what I see

Capture

and this is after I disabled all of my extensions

2 years ago
1
Bookie0
Bookie0

@CoolCoderSJ
yea I have some Chrome Flags..

Due to application errors, for new lines, type a | right after the first line, and pretend all space after that is a new line.

seriously?

Screen Shot 2020-12-20 at 12.27.09 PM

what's wrong with this?

and what about this?
Screen Shot 2020-12-20 at 12.29.37 PM

also you should add colors for the errors, and also specify what went wrong. You should also add more stuff! :)

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
yeah i really need to fix this, didn't think it was that broken

for the first one:
I think ur doing it fine, and for now u can use the manual level picker since inputs only come at the end.. i need to go through my code and accept spaces everywhere

for the second one: Again same thing:
I think ur doing it fine, and for now u can use the manual level picker since inputs only come at the end.. i need to go through my code and accept spaces everywhere

Also I ask you to put the | because I don't know how to accept multi line inputs in the console

2 years ago
1
Bookie0
Bookie0

@CoolCoderSJ
yez yez I do know I'm doing it fine, I'm just highlighting that ur "bot" can't see that it is correct and you should prolly correct it! ;0

Also I ask you to put the | because I don't know how to accept multi line inputs in the console

Β―\_(ツ)_/Β―

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
all right i went through my code, and I'm pretty sure that it accepts any number of spaces now (hopefully)
I do plan to add functions, lists, dictionaries, and 2d lists in the future, any suggestions for more?

2 years ago
1
Bookie0
Bookie0

@CoolCoderSJ
imports? eg random, time, etc.
maybe useful pieces of code (slowprint, clear screen, ANSI escape codes for colors and bold/italic)

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
ohk ill prob add a popular modules and their commands section

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
yay! I found a way to accept multi line input, so now u can hit enter and type normally for the if statement

2 years ago
1
elipie
elipie

@CoolCoderSJ
make lexer instead of something else...

2 years ago
1
elipie
elipie

@CoolCoderSJ
well.. python is the most misused(and the source of spam on replit) and really slow. You want something compiled

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@elipie
wait let me get this right, u hate python because ppl spam python repls? wut a twisted logic
U don't need compiling, Pythons more lightweight
wdym by misused

2 years ago
1
elipie
elipie

@CoolCoderSJ
hmm, i see you have been on repl as long as me... hmm Have u been active on repl latley? lots of spamming lol

Yes u do ned compile... fast af boii

while python is:
[insert turtle with python head here]

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@elipie
I am active, i did see the spam, but u cant base judgement of a language on that.
Compiling can be fast, but its really heavy, and python has tons more than just turtle.
Ever heard of web.py, flask, web2py, etc?
Reddit used to run on web.py, and Netflix and Lyft runs on flask

2 years ago
1
elipie
elipie

@CoolCoderSJ
exactly, python has became so big that its kinda boring, once you know all of it. And, you can easily get lost(a bad thing) once you are in the language. Thats why I am suggesting a different language

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@elipie
i...don’t think it’s boring..and there’s tons of documentation..
What language would u suggest..?

2 years ago
1
programmeruser
programmeruser

@CoolCoderSJ
there's a reason people use compiled languages, it's because they're fast.
And python suffers from serious performance problems making it a slow language (see https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python.html).
Node.js is much faster than Python and still manages to be simple.

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@programmeruser
ok true, compiled can be fast, but I disagree with the fact that node js is simpler than python.

First there's the fact that there's .then() , .catch(), async functions, and it can be confusing to use those/know where to put them. I can type a line of code in python that takes 5 lines in node.js.

Second, there's the fact that python can be used for many things, like coding AI.
Yeah, Python is the #1 language to use for coding AI.

Third, python has mutatable and non mutatable (list vs tuple) while js doesnt

Fourth, python has a lot more inbuilt modules, while js doesn't have that many. that means more of npm, whereas pip3 isn't needed that often.

Btw I'm saying all these things from experience, because I have used both node and python.

2 years ago
1
programmeruser
programmeruser

@CoolCoderSJ

I can type a line of code in python that takes 5 lines in node.js.

I suspect that's because Python uses synchronous approaches which seem to be more "simple" for beginners.

Second, there's the fact that python can be used for many things, like coding AI.

Did you know that AI and most scientific libraries are not written in Python, but in C++? If they were written in Python then they would be slow to the point of unusable.

Third, python has mutatable and non mutatable (list vs tuple) while js doesnt

Can't you just use immutable.js? And how many times have you actually used those?

Fourth, python has a lot more inbuilt modules

Node has a decent amount of built-in modules.

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@programmeruser

I suspect that's because Python uses synchronous approaches which seem to be more "simple" for beginners.

Is that really an issue if it does the same thing in an easier way?

Did you know that AI and most scientific libraries are not written in Python, but in C++? If they were written in Python then they would be slow to the point of unusable.

From a really simple bing search -

Python

Python: Python is viewed as in any case in the rundown of all Artificial Intelligence (AI) development programming languages because of the simplicity.
techindiatoday.com

Python. Python is considered to be in the first place in the list of all AI development languages due to the simplicity. The syntaxes belonging to python are very simple and can be easily learnt.
geeksforgeeks.org

First two things that come up...

Can't you just use immutable.js? And how many times have you actually used those?

While mutatable is much better to work with, immutable is preferred for faster run and shorter projects.

Node has a decent amount of built-in modules.

Its kind of annoying how I have to manually install packages in replit for node whereas with python i can type
import ... to automatically install

Additionally,

"
At this moment, there are more than 66,000 Python vacancies on Indeed and more than 40,000 JavaScript jobs.
"
Python has 22,000 more jobs available right now than js

2 years ago
1
programmeruser
programmeruser

@CoolCoderSJ
repl.it automatically installs Node.js packages.
The synchronous nature of Python is detrimental to its performance.
I forgot to mention this above, but you can create immutable objects with Object.freeze and clone objects with Object.assign.

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@programmeruser

repl.it automatically installs Node.js packages.

Ive tried with numerous repls, and it hasn't worked for me..sooo

I forgot to mention this above, but you can create immutable objects with Object.freeze

Again, node is so complicated. object.freeze? imutable objects in python are defined so simply..
imutable_var = ( "thing", "thing2", etc.)

Also you dropped 2 of my arguments, that hurts your case pretty badly.......

2 years ago
1
programmeruser
programmeruser

@CoolCoderSJ
if it hasn't worked for you, file a bug report at https://repl.it/bugs. It has nothing to do with the language itself.
How is a call to Object.freeze so complicated? The syntax for tuples is just syntactic sugar.

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@programmeruser

syntactic sugar??

let me also say something,

node is mainly built on objects, like

const that_thing {a buncha values so tat u have to use that_thing as an object}

Also u dropped 2 of my arguments (again) which still hurts your case....

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

lol

@Bookie0
be missing the debate
wouldnt be surprised if
@programmeruser
is ignoring....
:O
prob just got stuff to do

2 years ago
1
programmeruser
programmeruser

@CoolCoderSJ
what's wrong with objects?

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@programmeruser
nothings wrong with them, but

  1. Objects arent always needed
  2. They can be kinda hard to learn
2 years ago
1
programmeruser
programmeruser

@CoolCoderSJ
what do you mean they're hard to learn?
And you aren't required in use objects in js.

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0
oh yes im so sorry i will move this to a new thread

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Bookie0

imports? eg random, time, etc.

Im done with everything I planned, anything else?

2 years ago
1
Georgettes
Georgettes

Thanks for sharing this imformative tutorial.
https://www.myccpay.net/

11 months ago
1
Jamesn69
Jamesn69

Thanks for the step by step tutorial. Works like a charm!

https://www.walgreenslistens.kim/

1 year ago
1
Dekay4
Dekay4

HOW THE HELL DID YOU DO THIS!?!?!?!?!? I NEED ANSWERS PLS!!!!

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@Dov4k
lmao thanks, it took me a while, basically just made it in my free time.

Im working on an Web Dev tutorial atm...

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@MrDQuinn
@danparaskev
i see you all want to edit the tutorial...
While i cant allow direct editing, you can create a pull request on the Github Repo

(Just try editing the file normally, and it will ask you if u want to propose your change)

2 years ago
1
jimmytranscript
jimmytranscript

Need some help with Level 7!
I keep getting an error message on line 3 when trying to call my function.
my_func() isn't working for some reason.
Let me know what I'm doing wrong please

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@jimmytranscript
hmmm
what are you entering?
are u calling it at the end?
did u put at least 3 when it asked you for num of lines?

2 years ago
1
alanchen12
alanchen12

Just a note -
For the IDE's part (the pdf), it says atom does not have a terminal. However, there are packages that allow you to have a terminal. Also, the IDE part does not have VSCode >:(


@CoolCoderSJ

Also you should add a cancel account creation option

2 years ago
1
TheRealSnowSJ
TheRealSnowSJ

@alanchen12
1) All right, I will add that later on
2) Sorry if this offends you but VSCode is overrated. I downloaded it a week ago, and it’s exactly what repl.it is just offline, and without cool features like hosting, db, etc.

  1. I will add that
2 years ago
Load more