Course: Web Application Development Using Python (ICTC5)
Instructor: George Khoury
Revision: 1
Last updated: 12-07-2020
Submission Date: No submission required.
-
Create a function
check_ten(n1, n2)
which returns a Boolean True if the sum of the numbers is 10. -
Create a function
sum_ten(n1, n2)
which returns a Boolean True if the sum of the numbers is 10. Otherwise, return the actual sum value. -
Create a function
first_upper(astring)
which returns the first letter in the string in upper case. -
Create a function
last_two(astring)
which returns the last two characters as a tuple. If there are less than two characters, return the value "Error". -
Create a function
seq_check(numbers)
which when given a list of integers, returns True if the sequence[1,2,3]
appears somewhere in that list. -
Create a function
compare_length(s1, s2)
which returns the difference in length between the strings. -
Create a function
sum_or_max(my_list)
, given a list, if the length of the list is even return the sum of the list. If the length is odd, return the maximum value in that list.
You can find suggested solutions to the problems above here.