Skip to content

if you don't know how to use python you can learn here or in https://www.python.org/, this is not a official PSF project

License

Notifications You must be signed in to change notification settings

Python-leatning-lounge/variables-python-lesson-102

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Lesson 2: Writing and Reading Variables in Python

Welcome to Lesson 2 of the Python Learning Lounge! In this lesson, we will cover the basics of writing and reading variables in Python.

Objectives

By the end of this lesson, you will be able to:

  • Understand what a variable is in Python.
  • Assign values to variables.
  • Print variables to the console.

Lesson Content

Variables in Python

Variables are fundamental elements in programming that allow you to store and manipulate data. In Python, you can create a variable by assigning a value to a name using the = operator.

Example

Here's a simple example to illustrate how to create and use variables in Python:

# To start we will need to do is this
name = "John Doe"

# A variable in Python is when you put a wordkey before a = and putting the message after the =
# Now let's print this with what we learned in Lesson 101
print("Hello, " + name)

Explanation

  1. Creating a Variable:

    • name = "John Doe": This line creates a variable named name and assigns it the value "John Doe".
  2. Printing a Variable:

    • print("Hello, " + name): This line prints the message "Hello, John Doe" to the console by concatenating the string "Hello, " with the value of the name variable.

Summary

In this lesson, we've learned how to create variables in Python and how to print them to the console. Variables are essential for storing and manipulating data, and they form the foundation for more complex programming concepts.

Feel free to experiment with different variable names and values to get more comfortable with the concept!


Feel free to modify this README as needed.

About

if you don't know how to use python you can learn here or in https://www.python.org/, this is not a official PSF project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages