Skip to content

Instantly share code, notes, and snippets.

@acryon
acryon / homework.py
Created March 16, 2024 01:21
Lesson 13 Homework
# Homework Lesson 13 - Workshop - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
################################################################################
### When solving coding challenges, think about the time complexity (Big O). ###
################################################################################
# Challenge 1
# Common Elements Finder
@acryon
acryon / homework.py
Created March 14, 2024 18:54
Lesson 12 Homework
# Homework: Classes
# Read carefully until the end before you start solving the exercises.
# Practice the Basics
# Basic Class
# - Create an empty class HouseForSale
# - Create two instances.
# - Add number_of_rooms and price as instance attributes.
@acryon
acryon / homework.py
Created March 11, 2024 15:16
Lesson 11 Homework
# HOMEWORK: Dictionaries
# Read carefully until the end before you start solving the exercises.
# Basic Dictionary
# Create an empty dictionary and then add a few of your friends. Make the key their email (can be fake)
# and the value their name. When you're done, create the same dictionary as a pre-populated dictionary.
friends = {}
friends['friend1@email.com'] = 'Anna'
@acryon
acryon / homework.py
Created March 6, 2024 23:53
Lesson 10 Homework
# Homework Lesson 10 - Workshop - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
################################################################################
### When solving coding challenges, think about the time complexity (Big O). ###
################################################################################
# Challenge 1
# Multiplication of a three-digit number
@acryon
acryon / homework.py
Created March 3, 2024 23:18
Lesson 9 Homework
Homework Functions
# Read carefully until the end before you start solving the exercises.
# Basic Function
# Define a basic function that only prints Hello. Create the definition using def and the call that executes it.
def say_hello():
print("Hello")
say_hello()
# ----------------------------------------------------------------------------------------------------------------------
@acryon
acryon / homework.py
Last active March 5, 2024 06:10
Lesson 8 Homework
# Homework Lesson 8 - Workshop - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# Challenge 1
# Two Lowest Elements
#
# Your task is to write a program that takes a list of numbers and finds
# the two smallest numbers in it. The two smallest numbers can be equal to
# each other or different.
@acryon
acryon / homework.py
Created February 23, 2024 22:02
Lesson 7 Homework - Andrea Ryon
# Lesson 7 Homework : Loops
# 🔥Read carefully until the end before you start solving the exercises🔥
# Practice the Basics 💪🏻
# You can uncomment or type the necessary code on each task
# ---------------------------------------------------------------------
# Task 1. Create a basic for loop
@acryon
acryon / homework.py
Created February 21, 2024 23:56
Lesson 6 Homework - Andrea Ryon
Homework Lesson 6: Lists
# 🔥Read carefully until the end before you start solving the exercises🔥
# Practice the Basics 💪🏻
# Empty, Pre-populated, and Lists within Lists
# You can uncomment or type the necessary code on each task
@acryon
acryon / gist:49bb214d0238869e2ea3939a389ac3dc
Created February 19, 2024 22:03
Lesson 5 Homework - Andrea Ryon
# Homework Lesson 5 - Workshop - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# Challenge 1
# Make a number Positive
#
# Create a variable called my_number and set it to any integer value.
# Write code to make the number positive if it's negative, and keep it
# as is if it's already positive or zero.
@acryon
acryon / homework.py
Created February 15, 2024 23:00
Lesson 4 Homework - Andrea Ryon
# Homework Lesson 4 - Conditionals
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# ---------------------------------------------------------------------
# Exercise 1: Temperature Classification
# You're developing a weather application. Write a program that takes
# a temperature in Fahrenheit as input. If the temperature is above
# 85°F, print "Hot day ahead!".
temperature = int(input("Enter the temperature in Fahrenheit: "))