Lab 3
Lab 3
This lab will test your ability to define and call functions as well as to operate with strings and use various
string methods. Place appropriate comments in your program. Due: 11:59pm, Sunday, Feb. 4, 2018
QUESTION: Programming is prevalent among all engineering and science disciplines, as well as teaching. Here are
some useful functions when dealing with student records at a university. The starter code below provides an optional
testing block. When you are ready to test your functions, uncomment the testing block at the bottom of the starter
code, then comment it again when you are done testing and ready to submit to MarkUs. The test-cases at the end of
this manual will help you understand sample inputs and outputs.
TO DO: Download the file lab3.py, complete the functions inside according to their descriptions and
upload your version of lab3.py to MarkUs.
def max_number(s):
'''
(str) -> float
>>> max_number('10.0,20.0')
20
'''
def first_name_last_name_to_email(name):
'''
(str) -> str
Given a string name with the format "first_name last_name", return a string
"[email protected]", where all letters are lowercase.
max_number('10.0,20.0',)
20.0
max_number('45.0,67.8',)
67.8
max_number('-5,-6.7',)
-5.0
first_name_last_name_to_email('Hana Hastings',)
[email protected]
first_name_last_name_to_email('Chang Chen',)
[email protected]
first_name_last_name_to_email('Dan Dorval',)
[email protected]
student_midterm_mark('Hanna Hastings', '10.0,20.0')
<[email protected],20.0>