Codecademy Python3 Code Challenges 1: Count Letters

letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
# Write your unique_english_letters function here:
def unique_english_letters(word):
  unique_letters = []

  for letter in word:
    if letter in letters and letter not in unique_letters:
      unique_letters.append(letter)
  return len(unique_letters)

# Uncomment these function calls to test your function:
print(unique_english_letters("mississippi"))
# should print 4
print(unique_english_letters("Apple"))
# should print 4

Codecademy Python3 Project: Basta Fazoolin’ (my code)

class Menu:
  def __init__(self, name, items, start_time, end_time):
    self.name = name
    self.items = items
    self.start_time = start_time
    self.end_time = end_time

  def __str__(self):
    return "{} menu is available from {} to {}.".format(self.name, self.start_time, self.end_time)

  def calculate_bill(self, purchased_items):
    self.purchased_items = purchased_items

    total_bill = 0

    for item in self.purchased_items:
      total_bill += self.items.get(item, 0)
    return total_bill



brunch_items = {
  'pancakes': 7.50, 'waffles': 9.00, 'burger': 11.00, 'home fries': 4.50, 'coffee': 1.50, 'espresso': 3.00, 'tea': 1.00, 'mimosa': 10.50, 'orange juice': 3.50
}

early_bird_items = {
  'salumeria plate': 8.00, 'salad and breadsticks (serves 2, no refills)': 14.00, 'pizza with quattro formaggi': 9.00, 'duck ragu': 17.50, 'mushroom ravioli (vegan)': 13.50, 'coffee': 1.50, 'espresso': 3.00,
}

dinner_items = {
  'crostini with eggplant caponata': 13.00, 'caesar salad': 16.00, 'pizza with quattro formaggi': 11.00, 'duck ragu': 19.50, 'mushroom ravioli (vegan)': 13.50, 'coffee': 2.00, 'espresso': 3.00,
}

kids_items = {
  'chicken nuggets': 6.50, 'fusilli with wild mushrooms': 12.00, 'apple juice': 3.00
}

brunch = Menu("brunch", brunch_items, 1100, 1600)

early_bird = Menu("early bird", early_bird_items, 1500, 1800)

dinner = Menu("dinner", dinner_items, 1700, 2300)

kids = Menu("kids", kids_items, 1100, 2100)

#print(brunch)

brunch_bill = brunch.calculate_bill(["pancakes", "home fries", "coffee"])

#print(brunch_bill)

early_bird_bill = early_bird.calculate_bill(["salumeria plate", "mushroom ravioli (vegan)"])

#print(early_bird_bill)

all_menus = [brunch, early_bird, dinner, kids]




class Franchise:
  def __init__(self, address, menus):
    self.address = address
    self.menus = menus
  
  def __str__(self):
    return "{}".format(self.address)

  def available_menus(self, time):
    for menu in self.menus:
      if time >= menu.start_time and time < menu.end_time:
        print(menu, end = "\n\n")
    return ""



flagship_store = Franchise("1232 West End Road", all_menus)

new_installment = Franchise("12 East Mulberry Street", all_menus)

#print(flagship_store)
#print(new_installment)
#print(flagship_store.available_menus(1200))
print(flagship_store.available_menus(1700))



class Business:
  def __init__(self, name, franchises):
    self.name = name
    self.franchises = franchises

first_business = Business("Basta Fazoolin' with my Heart", [flagship_store, new_installment])



arepas_items = {
  'arepa pabellon': 7.00, 'pernil arepa': 8.50, 'guayanes arepa': 8.00, 'jamon arepa': 7.50
}

arepas_menu = Menu("arepas", arepas_items, 1000, 2000)

arepas_place = Franchise("189 Fitzgerald Avenue", arepas_menu)

new_business = Business("Take a' Arepa", [arepas_place])


Codecademy Python3 Project: Hacking The Fender (my code)

import csv

compromised_users = []

with open('passwords.csv') as password_file:
  password_csv = csv.DictReader(password_file)

  for row in password_csv:
    compromised_users.append(row['Username'])

with open('compronised_users.txt', 'w') as compromised_user_file:
  for user in compromised_users:
    compromised_user_file.write(user)

import json

with open('boss_message.json', 'w') as boss_message:
  boss_message_dict = {
    "recipient": "The Boss",
    "message": "Mission Success"
  }

  json.dump(boss_message_dict, boss_message)


with open('new_passwords_csv', 'w') as new_passwords_obj:

  slash_null_sig = """
   _  _     ___   __  ____             
/ )( \   / __) /  \(_  _)            
) \/ (  ( (_ \(  O ) )(              
\____/   \___/ \__/ (__)             
 _  _   __    ___  __ _  ____  ____  
/ )( \ / _\  / __)(  / )(  __)(    \ 
) __ (/    \( (__  )  (  ) _)  ) D ( 
\_)(_/\_/\_/ \___)(__\_)(____)(____/ 
        ____  __     __   ____  _  _ 
 ___   / ___)(  )   / _\ / ___)/ )( \
(___)  \___ \/ (_/\/    \\___ \) __ (
       (____/\____/\_/\_/(____/\_)(_/
 __ _  _  _  __    __                
(  ( \/ )( \(  )  (  )               
/    /) \/ (/ (_/\/ (_/\             
"""

  new_passwords_obj.write(slash_null_sig)

The Mastering Of Self: The Ultimate Guide To Your Saturn Return – xoNecole: Lifestyle, Culture, Love, & Wellness

A Saturn Return in the 10th house is here to help you build new systems of success for your career. The 10th house rules your professional and public life, social status, skills, talents, where you shine in life, and also your reputation.
β€” Read on www.xonecole.com/saturn-return-meaning-astrology/saturn-return-in-the-8th-house

Astrology advice: How to prepare for the Saturn Return – The Baltimore Banner

The good news is that Saturn is reliable and predictable in its demands. This is a slow-moving process and it takes about three years for Saturn to move through an astrological house. Saturn represents the way you experience the universe as you have structured it. Saturn energy requires discipline and hard work and shows what is real and tangible.
β€” Read on www.thebaltimorebanner.com/culture/astrology/astrology-preparing-for-saturn-return-FE3XU7TJTVG2ZORTJCO6OCN5AA/

Effect of transit of saturn in houses – AstroVidhi

Tenth house indicates occupation, profession and status. The Saturn’s transit highlights these areas and causes delays in professional success. There is a loss of status in the society and the native suffers from a financial crunch. The native suffers from mental agony and pain.
β€” Read on www.astrovidhi.com/effect-of-transits-of-planets-in-houses/effect-of-transit-of-saturn-in-houses/

✍️ πŸ‡ΊπŸ‡Έ πŸ€– ☠️ πŸ‘‘ πŸƒ