Processing math: 100%
< Back

Lab 16: Practice and Test 2 Makeup


Practice Problem 1

Write a function called remove_hashtags(text), which prints a version of text with all of the hashtags (#) removed

Example

>>> remove_hashtags("#INQ241A")
INQ241A
>>> remove_hashtags("##255, 118, 202", 3)
255, 118, 202
>>> remove_hashtags("#this #is #a #tumblr #post")
this is a tumblr post

Hint


Practice Problem 2

Write a function count_divisors(some_integer), which takes an integer as a parameter. This function should return the number of positive integers that divide some_integer.

Example

>>> count_divisors(1)
0
>>> count_divisors(2)
1
>>> count_divisors(7)
1
>>> count_divisors(10)
3

Hint


Test Makeup

You are not allowed to view any additional files when working on this exercise, nor are you allowed to consult with your neighbors. When you are done, submit your file on inquire.


Checkers

In a file called checkers.py, write a function called replace_black(a_picture). This function should replace all black pixels with blue pixels.