COVER_PRICE = (24.95 * 100)
DISCOUNT = 0.4
SHIPPING_COSTS_FIRST = (3 *100)
SHIPPING_COSTS_REST = 75
COPIES = 60
discounted_price = COVER_PRICE - COVER_PRICE * DISCOUNT
wholesale = discounted_price * COPIES + (SHIPPING_COSTS_FIRST + SHIPPING_COSTS_REST * (COPIES - 1))
print(wholesale /100)

number_A = 100
number_B = 0
number_C = number_A/number_B

def AddTime (start_time,hours):
total_hours = start_time + hours
timer = total_hours % 24
return(timer)
AddTime (14,535)

def Count_letters (instr):
instr_nospacers = str(instr).replace(" ","")
input_string = sorted(str(instr_nospacers).casefold())
counter_dict = {}
for each_letter in input_string:
if counter_dict.get(each_letter):
counter_dict[each_letter] += 1
else:
counter_dict[each_letter] = 1
return (counter_dict)
Count_letters ("Hello my Name is Charles")

"""
Commented text like this is given as the expected answer.
When running the cell, you will notice it renders it.
Can you come up with a way to keep this in the cell but making sure the print ignores it?
"""

"""
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
Blast off!
"""
# Countdown
def countdown(start):
for i in range(start,0,-1):
print(i)
print('Blast off!')
countdown(20)

"""
a = [2, 4, 6, 12, 15, 99, 100]
100
2
4
"""
# Your functions
def Get_largest (num_list):
return max(num_list)
def Get_smallest (num_list):
return min (num_list)
def Num_of_div3 (num_list):
counter = 0
for x in num_list:
if x%3 == 0:
counter +=1
return counter
a = [2, 4, 6, 12, 15, 99, 100]
print(Get_largest (a))
print(Get_smallest (a))
print(Num_of_div3 (a))

"""
5 bottles of beer on the wall, 5 bottles of beer. Take one down, pass it around, 4 bottles of beer in the wall
4 bottles of beer on the wall, 4 bottles of beer. Take one down, pass it around, 3 bottles of beer in the wall
3 bottles of beer on the wall, 3 bottles of beer. Take one down, pass it around, 2 bottles of beer in the wall
2 bottles of beer on the wall, 2 bottles of beer. Take one down, pass it around, 1 bottle of beer in the wall
1 bottle of beer on the wall, 1 bottle of beer. Take one down, pass it around, 0 bottles of beer in the wall
"""
def singing(number_of_bottles):
for i in range(number_of_bottles,0,-1):
if i == 1:
btl = "bottle"
else :
btl = "bottles"
if (i-1) == 1 :
btl2 = "bottle"
else :
btl2 = "bottles"
startstr = (str(i) + ' '+ btl +' of beer on the wall, ' + str(i) + ' '+ btl +' of beer. Take one down, pass it around, ' + str(i-1) + ' '+ btl2 +' of beer in the wall ')
print(startstr)
singing(10)

"""
Fibonacci sequence up to 22 :
0 , 1 , 1 , 2 , 3 , 5 , 8 , 13 , 21
"""
# Fibonacci
def fib(max_num) :
x ,y = 0 ,1
output=[0]
while y < max_num :
output.append(y)
x, y = y, x+y
replaced_chars = "[]"
rp_length = len(replaced_chars)
stringo = str(output)
removed_chars = str.maketrans(replaced_chars ,rp_length*" ")
print("Fibonacci sequence up to " + str(max_num) + ":" + "\n" + stringo.translate(removed_chars).strip())
fib(22)

def prime(max_numb):
primes = []
for possiblePrime in range(2, max_numb+1):
# Assume number is prime until shown it is not.
isPrime = True
for i in range(2, possiblePrime):
if possiblePrime % i == 0:
isPrime = False
break
if isPrime:
primes.append(possiblePrime)
print(primes)
prime(30)

"""
2 = 1**2 + 1**2
4 = 0**2 + 2**2
4 = 2**2 + 0**2
5 = 1**2 + 2**2
5 = 2**2 + 1**2
8 = 2**2 + 2**2
9 = 0**2 + 3**2
9 = 3**2 + 0**2
"""

"""
A = 2
B = 1
C = 7
D = 8
"""
# Solve 4*ABCD == DCBA