1/31
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Python
an interpreted, object-oriented, high-level programming language
created by Guido van Rossum and released in 1991
Why Use Python?
Easy to learn and use
Versatile
Large community and ecosystem
Cross-platform support
High-level language
Interpreted language
Easy to learn and use
has a simple and easy-to-read syntax
Versatile
python can be used for a wide range of applications including web dev, data analysis, ai, scientific computing, game dev, etc.
Large community and ecosystem
python has a large and active community of developers who contribute to the development of libraries and tools
Cross-platform support
python can use a variety of platforms (windows, macOS, linux, etc.)
High-level language
python is designed to be more human-readable, making it easier to write and maintain code
Interpreted language
no need to compile code before it can be executed, making it easier to write and test code
Why Use Python?
Web Apps
For Data Science and Data Visualization
Machine Learning
Script for Vulnerability Testing
Variables
containers used to store the value or results
a named location reserved to store values in the memory
equal sign (=) is used to assign values to variables
subject (the variable) = “fop” (the value)
Data Types
String
Integer
Float
Boolean
name = “Micaila Almin”
str or string
age = 18
int or integer
grade = (99.9)
float
continue = True
boolean
Naming Variables
The name of the variable must be composed of upper-case or lower-case letters, digits, and the character _ (underscore)
The name of the variable must begin with a letter
The underscore character is a letter
Upper- and lower-case letters are treated as different
The name of the variable must not be any of Python's reserved words/keywords
Keywords
reserved keywords because you musn’t use them as names
predefined
Indentation
used to indicate a code block
if a == 1
print(“Yes”)
print() function
built-in function
prints/outputs a specified message to the screen/console window

Two keyword arguments of print() function
end
sep (separator)

Common Escape Sequence

input() function
accepts user input
name = input(“Enter Full Name:”)
print(“Name:” + name)
Casting
converting one data type into another

Arithmetic Operators

String
series or characters interpreted as text
Concatenation

Multiple Line of Text
you can use 3 double quote or 3 single quote to display multiple text

Strings Placeholders
containers for strings and numbers:
{} format
%
F or f
String Formatting Functions

Comments
#This is a single line comment
Multi lined comment
#This is a comment
#written in
#more than just one line
“““ This is a comment written in more than just one line “““
Inline comment
print(“Hello World”) #This is an inline comment