Write a function in Python called 'factorial()' that will take a positive integer as input and returns its factorial as output....
Search Results
Searching for: Python
Individual Exercises
Given an integer representing the radius of a sphere, compute and return the sphere's volume based on the following formula:
Volume = 4/3...
Complete the following function. When given aString, return True if it ends in "ly". Return False otherwise.
Complete the following function. Given aString, return the first half of characters in that string (the string "woohoo" yields "woo")....
Complete the following function. Given aString, return a copy of aString where any character next to a star (*) and all stars themselves...
Given an outside string of length 4, such as "(())"
, and an inside string, return a new string where the inside is squeezed in the middle...
Write a function in Python that implements the following logic: Given 2 int values a and b greater than 0, return whichever value is...
Write a function in Python that implements the following logic: The squirrels in Palo Alto spend most of the day playing. In particular,...
You have a green lottery ticket with three integers: a, b, and c. If all of the numbers are different on it, return 0. If two of the...
You have a green lottery ticket with three integers: a, b, and c. If all of the numbers are different on it, return 0. If two of the...
You have been given several good and bad versions of an 'isPrime()' function.
Write out some tests which will catch the buggy versions,...
You need some way to reverse the lookup process of some python dictionaries. While searching for a key in a dictionary is very fast,...
The forestry department needs help updating some old records of special trees in a nature preserve. They will give you a record of a...
Define a class called Backpack
. The Backpack class should have a initializer method (aka constructor) which creates two instance...
Your task: Construct a Python program that prints strings "Hello", "Parsons", and "Problems" on their own lines. You can get feedback on...