Loading [MathJax]/jax/output/HTML-CSS/jax.js
< Back

Lab 22: Sounds


Practice Problem 1

Write a function called maximum(a_list), which takes a list of integers as a parameter. Your function should print the maximum of the values in the list.

Example

>>> maximum([0, 1, 2])
2
>>> maximum([1, 1, 1, 1, 1, 1])
1
>>> maximum([2, 8, 6, 4])
8

Hint


Practice Problem 2

Write a function called print_firsts(a_list), which takes as a parameter a list of string. Your function should print only the first character of every string in the list.

Example

>>> print_firsts(["alpha", "beta", "charlie", "delta", "echo", "foxtrot"])
a
b
c
d
e
f
>>> print_firsts(["INQ", "241"])
I
2
>>> print_firsts(["I", "<3", "yik", "yak"])
I
<
y
y
>>>

Hint


Adding Sound

In a file called adding_sounds.py write a function called combine_sounds(sound_1, sound_2). This function should create a new sound, which is the result of appending sound_1 to the end of sound_2.

Example

Before

Alpha

Bravo

After

Alpha Bravo

Hint