Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def text_messaging(texts_per_month, num_canadians):
- """ (int, int) -> list
- Precondition: texts_per_month and num_canadians must be positive integers
- Per instruction at http://bit.ly/2HgbdYJ
- - total_texts should be in terms of billions (rounded to one decimal),
- - millions_per_day should be in terms of millions (rounded to one decimal),
- - average_canadian_text_num_per_year should be in terms of ones (rounded to
- the nearest int)
- - average_canadian_time_texting should be in terms of hours (rounded to one
- decimal)
- >>> text_messaging(3000000000, 10000000)
- [36.5, 100.0, 3600, 30.0]
- Write your code for this function below.
- """
- total_texts = <insert formula here>...
- millions_per_day = <insert formula here>...
- average_canadian_text_num_per_year = <insert formula here>...
- average_canadian_time_texting = <insert formula here>...
- return [total_texts, millions_per_day, average_canadian_text_num_per_year, average_canadian_time_texting]
- if __name__ == '__main__':
- import doctest
- print(doctest.testmod())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement