Data Structures - PR - 01

Kunaal ThanikKunaal Thanik
2 min read

Welcome, Eng!

Python Recall Session: Your Quick Reference Guide

This session is designed to serve as a quick recall resource for Python concepts. My aim is not to dive deep into topics but to provide a concise overview that allows you to efficiently refresh your knowledge. This guide will help you recall key Python concepts with minimal effort, making your learning process more efficient.

Stay tuned for a streamlined and effective recall experience!

Following topics will be covered, and will be adding more as necessary

  1. Basic Syntax and Data Structures:

    • Variables and Data Types

    • Lists, Tuples, Dictionaries, and Sets

Variables and Data Types:

You create a variable by assigning a value to it using the = operator.

writter_name = "Kunaal"
age = 27
is_sdet = True

Data Types:

Data types define the kind of data a variable can hold. Here are some common ones:

  1. Integers (int):

    • Whole numbers, positive or negative.

    • Example: amount = 2700amount = -200

  2. Floating-Point Numbers (float):

    • Numbers with a decimal point.

    • Example: amount = 3.14amount =-0.001

  3. Strings (str):

    • Sequence of characters enclosed in quotes.

    • Example: name="hello"position ='SDET/qa'

  4. Booleans (bool):

    • Represents True or False.

    • Example: is_sdet = True

  5. Lists:

    • Ordered items, can be of different types, mutable*(values can be changed)*.

    • Example: value = [100, 250, 327]stocks=["apple", "google", "tesla"]

  6. Tuples:

    • Ordered items, but immutable (values cannot be changed).

    • Example: employee_ids = (1, 2, 3)certificates =("first aid", "cpr")

  7. Dictionaries (dict):

    • Collection of key-value pairs.

    • Example: portfolio = {"company": "Apple", "owned_shares": 215}

  8. Sets:

    • Unordered unique items only.

    • Example: unique_numbers ={1, 2, 3}fruits ={"apple", "banana", "cherry"}

Stay tuned, next chapter would be String manipulation

0
Subscribe to my newsletter

Read articles from Kunaal Thanik directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Kunaal Thanik
Kunaal Thanik