import random
import math

def randomword():
    words = ['Hello', 'Goodbye', '#$#!@&']
    randword = random.choice(words)
    return randword
    #return random.choice(words) would replace the last 2 lines
    #return random.choice(['Hello', 'Goodbye', '#$#!@&'])

def maxnum(num1, num2, num3, num4):
    largest = num1

    if num2 > largest:
        largest = num2

    if num3 > largest:
        largest = num3

    if num4 > largest:
        largest = num4

    return largest

def greatest_element(alist):

    largest = alist[0]

    for item in alist[1:]:
        if item > largest:
            largest = item

    return largest


def hypotenuse(a, b):
    return math.sqrt(a**2 + b**2)

# raise_factor should be 0.03 for 3% raise
def salary_after_raise(current_salary, raise_factor):
    return current_salary * (1 + raise_factor)


# returns 1 + the number of spaces in user_str
# this typically coincides with the number of words in user_str
def count_words(user_str):
    num = 1

    for char in user_str:
        if char == ' ':
            num += 1
                
    return num

def number_of_positives(nums):
    count = 0

    for num in nums:
        if num > 0:
            count += 1

    return count


def number_of_odds(nums):
    count = 0

    for num in nums:
        if num%2 == 1:
            count += 1

    return count

def coin_flip():
    return random.choice(['Heads', 'Tails'])

def die_roll():
    #return random.choice([1,2,3,4,5,6])
    return random.randint(1,6)


def recommend_episode():
    season = random.randint(1,4)
    if season == 4:
        episode = random.randint(1,6)
    else:
        episode = random.randint(1,13)
    #print(f"We recommend you watch Monty Python's Flying Circus Series {season}, Episode {episode}.")
    return (season, episode)    

counts = [None]
for _ in range(45):
    counts.append(0)

for _ in range(200000):
    answer = recommend_episode()
    counts[(answer[0]-1)*13 + answer[1]] += 1

for item in counts[1:]:
    print(item)

# the prints above show that season 4 episodes are overreprented in the
# suggestions


##for _ in range(10):
##    print(coin_flip())


# this is a list that will keep a count of how many times the index was rolled
##counts = [None, 0,0,0,0,0,0]
##
##for _ in range(2000000):
##    #val = die_roll()
##    #counts[val] += 1
##    counts[die_roll()] += 1
##
##for i in range(1,len(counts)):
##    print(f"{counts[i]} {i}'s were rolled")
##    
##mynums = [10,20,3,87,88,67,34,-76,0,-10,60]
##numpos = number_of_positives(mynums)
##numodd = number_of_odds(mynums)
##print(f'There are {numpos} positive numbers in this list: {mynums}')
##print(f'There are {numodd} odd numbers in this list: {mynums}')
##

##sentence = 'Skidmore College is the place to be!'
##
##numwords = count_words(sentence)
##print(f'There are {numwords} words in the sentence: {sentence}')

##
##newsal = salary_after_raise(100000, 0.04)
##print(newsal)

##hyp = hypotenuse(28,45)
##print(hyp)

##mylist = [76,65,45,4,99,33,32,-9,90]
##large = greatest_element(mylist)
##print(large)

##x = -90
##large = maxnum(78,56,87,x)
##print(large)

##for _ in range(10):
##    someword = randomword()
##    print(someword)
