Skip to content

Instantly share code, notes, and snippets.

@TheBeege
Created December 18, 2016 08:53
Show Gist options
  • Save TheBeege/5704e4307c1607ab5f8f3949c4cf2457 to your computer and use it in GitHub Desktop.
Save TheBeege/5704e4307c1607ab5f8f3949c4cf2457 to your computer and use it in GitHub Desktop.
Python Preholiday Practicum
Create a function called print_square that takes in one integer and returns no output. print_square should print a square whose sides are the length of the integer parameter.
Create a function called get_even that takes in a list of numbers. It should return a list consisting of only the even numbers from the given list.
Create a function to test get_even. It should call get_even with a normal array, an empty array, an array of only even numbers, and an array of only odd numbers as inputs. If it fails to behave as expected, throw an error.
Create a function called convert_c_to_f. It should take in a number as its only parameter. It should return a number that converts the given number from Celsius degrees to Farenheit degrees. The formula for Celsius to Farenheit: Tc * (9/5) + 32.
Call print_square with 5 as an input.
Call convert_c_to_F with today's temperature and print it out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment