This is a test
Exercises
Follow Destiny's demonstration and define a function called editYes
that receives a parameter passed-by-reference that is of type ...
Follow Kevin's demonstration and create a program that reads from a file called contacts
that includes contact information. Each line has...
Write a function called file_exists
that receives the name of a file as a string
and determines whether or not that file exists, based on...
Complete the following binary search method on integers. Find the number search
in the array numbers
. Return the index of the element if...
Follow Kevin's example and create a function called add_student_to_roster
that receives:
- a student's name
- their identification number
...
Write a function called save_stickynote
that receives:
- the name of a file to save, as a
string
- a text note of information to save,...
Recursive procedure that returns the number of H in a string of heads (H) or tails (T) outcomes. This must be a recursive routine. You...
Code along with Jessica's example and implement the algorithm that does the following:
- Prompts the user for
"\nwhat is the name of the...
Define a struct called Instrument
to describe a musical instrument with the following attributes:
-
name
- a word that the instrument is...
Code along with Juan's example and implement the Video
class that does the following:
- Stores the following data using information...
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...
The method skeleton below takes in an integer variable top
.
Using a while
loop, write a method that will return the sum of all numbers...