Skip to content

Instantly share code, notes, and snippets.

@ransomjoy
ransomjoy / homework.py
Created July 30, 2024 22:20
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
@ransomjoy
ransomjoy / homework.py
Created May 18, 2024 04:08
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 basic_function():
print("Hello")
@ransomjoy
ransomjoy / homework.py
Created March 28, 2024 04:11
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.
@ransomjoy
ransomjoy / homework.py
Created March 20, 2024 22:51
lesson 7 homework
# 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
@ransomjoy
ransomjoy / homework.py
Created March 12, 2024 04:01
Lesson 6 homework
# Homework: 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
@ransomjoy
ransomjoy / homework.py
Created March 8, 2024 21:46
lesson 5 homework
# 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.
@ransomjoy
ransomjoy / homework.py
Created March 8, 2024 05:29
Lesson 4 homework
# 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!".
@ransomjoy
ransomjoy / homework.py
Created March 7, 2024 03:58
lesson 3 homework
# Homework Lesson 2 - Strings
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# ---------------------------------------------------------------------
# Exercise 1: Personalized Greeting
# Write a program that takes a user's name as input
# and then greets them using an f-string: "Hello, [name]!"
#
# Example Input: "Alice"
@ransomjoy
ransomjoy / homework.py
Created March 4, 2024 22:10
homework of lesson 2 for Python
# Homework Lesson 2 - Numbers - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# ---------------------------------------------------------------------
# Exercise 0 - This exercise is solved so you can have an ----------
# example of how we are expecting your answers to be.
#
# You are shopping online and found two items with prices $5.99
# and $3. Calculate and print the total cost.