Path: blob/master/03-Methods and Functions/09-Functions and Methods Homework - Solutions.ipynb
666 views
Functions and Methods Homework Solutions
Write a function that computes the volume of a sphere given its radius.
Write a function that checks whether a number is in a given range (inclusive of high and low)
If you only wanted to return a boolean:
Write a Python function that accepts a string and calculates the number of upper case letters and lower case letters.
If you feel ambitious, explore the Collections module to solve this problem!
Write a Python function that takes a list and returns a new list with unique elements of the first list.
Write a Python function to multiply all the numbers in a list.
Write a Python function that checks whether a word or phrase is palindrome or not.
Note: A palindrome is word, phrase, or sequence that reads the same backward as forward, e.g., madam,kayak,racecar, or a phrase "nurses run". Hint: You may want to check out the .replace() method in a string to help out with dealing with spaces. Also google search how to reverse a string in Python, there are some clever ways to do it with slicing notation.
Hard:
Write a Python function to check whether a string is pangram or not. (Assume the string passed in does not have any punctuation)
Hint: You may want to use .replace() method to get rid of spaces.
Hint: Look at the string module
Hint: In case you want to use set comparisons