Processing math: 100%
< Back

Lab 13: Images


Practice Problem 1

Write a function omit_letters(a_phrase, omitted_letters), which takes a string as a parameter. Your function should list all of the characters out of a_phrase, each on their own line. However, your program should only print the letters not included in the omitted letters string.

Example

>>> omit_letters("INQ 241A", "241")
I
N
Q

A
>>> omit_letters("Trexler", "e")
T
r
x
l
r

Hint


Practice Problem 2

Write a function perfect_squares(maximum_sqrt), which takes an integer as a parameter. This function should print all of the perfect squares whose square root is less than maximum_sqrt.

Example

>>> perfect_squares(10)
0
1
4
9
16
25
36
49
64
81
>>> perfect_squares(5)
0
1
4
9
16

Hint


Better Hair Replacement

In a file called hair_color.py, write a function called change_hair_to_red(picture). This function should take 1 parameters: the picture you are going to modify. Your function should use what you learned today in class to make the changing of the hair color better.

Example

Before After

Hint