0% found this document useful (0 votes)
3 views

Quick Guide To Python Basics ?

Uploaded by

enumanikyle
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Quick Guide To Python Basics ?

Uploaded by

enumanikyle
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Quick Guide to Python Basics 🚀

1. Data Types

Numbers: Whole numbers (integers) and decimal numbers (floats). Example: 5


(integer), 3.14 (float).

Strings: Text wrapped in quotes. Example: "Hello, World!".

Booleans: True or False values. Example: True, False.

2. Variables

Think of variables as containers for storing data. You give them a name and store a
value in them. Example: name = "Alice".

3. Numbers

Integers: Whole numbers like 7 or -3.

Floats: Numbers with decimals like 2.5 or -0.1.

4. Strings

Creation: Use quotes to create strings. Example: greeting = "Hi there!".

Concatenation: Join strings together with +. Example: "Hello " + "World" results in
"Hello World".

5. Casting

Convert one type to another. Example:


From number to string: str(5) gives "5".

From string to number: int("7") gives 7.

6. Booleans

True and False are used to check conditions. Example: x > 10 returns True if x is
greater than 10.

7. Operators

Arithmetic Operators: + (addition), - (subtraction), * (multiplication), / (division).

Comparison Operators: == (equal to), != (not equal to), > (greater than), < (less
than).

You might also like