0% found this document useful (0 votes)
30 views1 page

Python Basics Cheat Sheet

This cheat sheet provides a quick reference for Python basics, including how to define string and numerical variables. It also outlines common arithmetic operators with examples for addition, subtraction, multiplication, division, and exponentiation. Each concept is illustrated with simple code snippets for clarity.

Uploaded by

Zeyad Hamza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views1 page

Python Basics Cheat Sheet

This cheat sheet provides a quick reference for Python basics, including how to define string and numerical variables. It also outlines common arithmetic operators with examples for addition, subtraction, multiplication, division, and exponentiation. Each concept is illustrated with simple code snippets for clarity.

Uploaded by

Zeyad Hamza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Python Basics – Cheat Sheet

Variables
Concept Example
Defining string variables. my_message = "Hello World"
Defining numerical variables. pi = 3.14
value_of_pi = 3.1415926535

Arithmetic Operators
Concept Example
Addition num1 = 1
num2 = 2
sum_result = num1 + num2
Subtraction num1 = 2
num2 = 1
sub_result = num1 - num2
Multiplication num1 = 2
num2 = 3
mul_result = num1 * num2
Division num1 = 4
num2 = 2
div_result = num1 / num2
Exponentiation num1 = 2
num2 = 3
exp_result = num1 ** num2

You might also like