Day 2 Python

harichselvamc
1 min readJan 6, 2023

--

Day 2/20

On day 2 of your Python learning journey, you should continue going through the official Python documentation to deepen your understanding of the language. You can also work through the Codecademy Python course to get more hands-on practice.

Here are a few examples of concepts you might encounter on day 2, along with some code snippets that demonstrate how they work:

Data types:

# lists
names = ["Alice", "Bob", "Charlie"]

# dictionaries
student = {
"name": "Alice",
"age": 30,
"courses": ["math", "physics"],
}

# sets
unique_letters = set("abcabcabc") # {'a', 'b', 'c'}

Control structures:

# if statements
x = 10
y = 5

if x > y:
print("x is greater than y")
elif x < y:
print("x is less than y")
else:
print("x is equal to y")

# for loops
for i in range(5):
print(i)

# while loops
i = 0
while i < 5:
print(i)
i += 1

Functions:

def greet(name):
print("Hello, " + name)

greet("Alice") # prints "Hello, Alice"

I hope that these Python Preparation Plans will help you enhance your interest in programming as well as python and then all python topics. Please feel free to provide insightful remarks in the space below.

20days-python-plans

--

--

harichselvamc

I am a quick learner with a good eye for detail. I am also an exceptional coder with a great work ethic.