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
147

Python Lesson!

stoporinjail
stoporinjail

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

Announcements

8/17/2021 Thank you for 100 likes!

2 years ago
You are viewing a single comment. View All
3

@JWZ6
Ha I See You, Hello

2 years ago