def add(a, b):
    """Secte hodnoty promennych."""
    return a + b

def what_number(number):
    """Vrati retezec positive/zero/negative podle hodnoty number"""
    if number > 0:
        return "positive"
    elif number < 0:
        return "negative"
    else:
        return "zero"

def sum_of_numbers(numbers):
    """Vrati soucet hodnot v listu"""
    return sum(numbers)

def is_in_string(string, c):
    """Vrati True/False podle toho, zda retezec string obsahuje znak c"""
    return c in string

def how_many(string, c):
    """Vrati pocet vyskytu znaku c v retezci string"""
    occ = 0
    for char in string:
        if char == c:
            occ += 1
    return occ
    # return string.count(c)    

def player_name(players, no):
    """Vrati jmeno hrace podle zadaneho cisla."""
    if no in players:
        return players[no]
    else:
        return None

def divides(m, n):
    """Vrati list cisel od 1 do m, ktera jsou delitelna cislem n.""" 
    lst = []
    for i in range(1, m+1):
        if i % n == 0:
            lst.append(i)
    return lst
    # return [i for i in range(1, m+1) if i % n == 0] 


print(add(1, 3))
print(add([1, 2, 3], [4, 5, 6]))
# Try addition of strings or different data type and see what happens

n = 5
print(f"Number {n} is {what_number(n)}")

lst = [1, 2, 3, 6, 7, 8]
print(f"Sum is: {sum_of_numbers(lst)}")

# create nice formatting of the output
print(is_in_string('Ostrava', 's')) # True
print(how_many('Ostrava', 'a')) # 2
print(how_many('Ostrava', 'q')) # 0

players = {11: 'Hrubec', 84: 'Kundratek', 88: 'Sulak', 38: "Hyka", 46: 'Krejci', 45: 'Sedlak'}
no = 46
print(f"Number {no} is {player_name(players, no)}")

# create nice formatting of the output
print(divides(12, 3)) # 3 6 9 12
print(divides(10, 7)) # 7

