0% found this document useful (0 votes)
5 views2 pages

Python Exam Study Guide Notes

The document provides an overview of Python, including its history, features, and data types such as numeric types and strings. It covers essential concepts like variables, lists, dictionaries, operator precedence, and coding blocks with indentation. Additionally, it explains list operations, slicing, and the immutability of tuples.

Uploaded by

davisu.4e
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 views2 pages

Python Exam Study Guide Notes

The document provides an overview of Python, including its history, features, and data types such as numeric types and strings. It covers essential concepts like variables, lists, dictionaries, operator precedence, and coding blocks with indentation. Additionally, it explains list operations, slicing, and the immutability of tuples.

Uploaded by

davisu.4e
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

PYTHON EXAM NOTES

1. History & Features of Python:

Python was created by Guido van Rossum in 1991. It is simple, readable, portable, open■source,
and supports multiple paradigms with a large standard library.

2. Python Variables:

Variables store data. Rules: start with letter/_ , no spaces, case■sensitive, no keywords.

Examples: age=20, name="Riya", price=99.5

3. Numeric Data Types:

int: 10, -5

float: 3.14, -9.8

complex: 3+4j, -2j

4. String Operations:

Concatenation (a+b), slicing (s[1:3]), comparison ("a"=="a").

5. Date & Time:

Use datetime module: [Link](), [Link](2024,5,20)

6. Lists vs Dictionaries:

List: ordered mutable collection → [10,20,30]

Dictionary: key■value pairs → {"name":"Amit", "age":20}

7. List Operations:

append(), insert(), remove(), slicing, len()

8. Operator Precedence:

(), **, *,/,%, +,-

Example: 10+5*2 = 20

9. Coding Blocks & Indentation:


Indentation defines scope. Example:

if x>10:

print("Big")

10. List Slicing:

nums[1:4], nums[::-1]

11. Tuples:

Immutable sequences.

t=(10,20); t[1]=5 → ERROR

You might also like