Python Basics
Last updated
Last updated
This section of the book will cover the basic skills to create variables, obtain keyboard inputs through the console, output data to the console, and do mathematical calculations.
Variable: A container that holds data for a program.
Function: A built-in or custom segment of executable code.
Comment: Human readable notes written by a programmer for others to read. Often used to describe certain aspects of the code.
Whenever we name a variable or a function we create an Identifier.
You donโt start a variable with capitals
There are no white spaces, we connect multi word variables with either camelCasing or under_scores.
Variable names should be effective and short, not vague.
Example of a Python Code using an Identifier
# Our First Line of Python Code
is an example of a comment
. The #
symbol creates a single line comment.
user_name = "Jane Doe"
is an example of a variable
containing the data "Jane Doe"
; it is using the under_score
naming convention
print(user_name)
is an example of using a function to output a value to the .