# [ ] create and populate list called days_of_week then print it
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
print(days_of_week)
# [ ] after days_of_week is run above, print the days in the list at odd indexes 1,3,5
print(days_of_week[0:7:2])
# [ ] create and populate list called phone_letters then print it
phone_letters = [" ", "", "ABC", "DEF", "GHI" "JKL", "MNO", "PQR", "STU", "VWX"]
print(phone_letters)
# [ ] create a variable: day, assign day to "Tuesday" using days_of_week[]
# [ ] print day variable
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
day = ""
for letters in days_of_week:
if letters == "Tuesday":
day += letters
else:
pass
print(day)
# PART 2
# [ ] assign day to days_of_week index = 5
# [ ] print day
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
day = ""
for letters in days_of_week:
if letters == "Saturday":
day += letters
else:
pass
print(day)
# [ ] Make up a new day! - append an 8th day of the week to days_of_week
# [ ] print days_of_week
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
days_of_week.append("Rainday")
print(days_of_week)
# [ ] Make up another new day - insert a new day into the middle of days_of_week between Wed - Thurs
# [ ] print days_of_week
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
days_of_week.insert(3, "Forsday")
print(days_of_week)
# [ ] Extend the weekend - insert a day between Fri & Sat in the days_of_week list
# [ ] print days_of_week
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
days_of_week.insert(5, "Funday")
print(days_of_week)
# [ ] print days_of_week
# [ ] modified week is too long - pop() the last index of days_of_week & print .pop() value
# [ ] print days_of_week
days_of_week = ["Monday", "Tuesday", "Wednesday", "Forsday", "Thursday", "Friday", "Funday", "Saturday", "Sunday", "Rainday"]
print(days_of_week.pop())
# [ ] print days_of_week
# [ ] delete (del) the new day added to the middle of the week
# [ ] print days_of_week
days_of_week = ["Monday", "Tuesday", "Wednesday", "Forsday","Thursday", "Friday", "Saturday", "Sunday"]
del days_of_week[3]
print(days_of_week)
# [ ] print days_of_week
# [ ] programmers choice - pop() any day in days_of week & print .pop() value
# [ ] print days_of_week
days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
print(days_of_week.pop(2))
# [ ] create let_to_num()
phone_letters = [" ", "", "ABC", "DEF", "GHI" "JKL", "MNO", "PQR", "STU", "VWX"]
print(phone_letters[9])
# [ ] Challenge: write the code for "reverse a string"