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

Python Basics Summary

The document outlines the basics of Python programming, covering key topics such as variables and data types, operators, control flow, functions, and collections. It also includes information on string manipulation, input/output operations, module usage, file handling, and exception management. This summary serves as a foundational guide for beginners to understand essential Python concepts.

Uploaded by

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

Python Basics Summary

The document outlines the basics of Python programming, covering key topics such as variables and data types, operators, control flow, functions, and collections. It also includes information on string manipulation, input/output operations, module usage, file handling, and exception management. This summary serves as a foundational guide for beginners to understand essential Python concepts.

Uploaded by

sfynhm799
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Basics Summary

1. Variables & Data Types:


- int, float, str, bool, list, tuple, dict, set

2. Operators:
- Arithmetic: +, -, *, /, //, %, **
- Comparison: ==, !=, >, <, >=, <=
- Logical: and, or, not

3. Control Flow:
- if, elif, else
- for loops, while loops
- break, continue

4. Functions:
- def function_name(params):
return value

5. Collections:
- list: ordered, mutable
- tuple: ordered, immutable
- dict: key-value pairs
- set: unordered, unique items

6. String Basics:
- Indexing: text[0], text[-1]
- Methods: lower(), upper(), strip(), split(), join()

7. Input/Output:
- input("Enter: ")
- print("Hello")

8. Modules:
- import module_name
- from module import function

9. File Handling:
- open("file.txt", "r")
- read(), readline(), write(), close()

10. Exceptions:
- try:
# code
except Exception as e:
# handle error

You might also like