project1_uLogin
, where you replace “uLogin
” with the beginning of your Drew e-mail address before the @
symbol:
bye.py
, convert.py
, fun.py
, string.py
, and madlibs.py
. To create a file, right-click on the project and select New > Python File
: Don’t forget to add a comment at the top of each program with your name and what the program does.
bye.py
:
Create a program convert.py
, that takes a temperature in degrees Fahrenheit as input and outputs the equivalent temperature in degrees Celsius. Your program should have 2 variables:
degrees_f
: holds a temperature in degrees fahrenheit (input from the user)degrees_c
: holds the temperature in degrees celsius. To convert fahrenheit to celsius, deduct 32 from the fahrenheit temperature and multiply by 5/9.Your program should print the values of both variables with a string description, such as: "F degrees fahrenheit = C degrees celsius"
, replacing F & C with the values of your variables.
For example:
degrees_f | degrees_c | output |
---|---|---|
86 | 30 | 86 degrees fahrenheit = 30 degrees celsius |
72 | 22 | 72 degrees fahrenheit = 22 degrees celsius |
32 | 0 | 32 degrees fahrenheit = 0 degrees celsius |
Write a program fun.py
that takes a float as input from the user and prints out the following information using the math module:
ceiling(3.75)
is 4)Think about how you can apply the concept of DRY coding (Don’t Repeat Yourself) to make your solution more concise.
Write a program string.py
that takes a string as input from the user and:
[:]
)For example:
string | Mangled Output | Middle 3 |
---|---|---|
Monty Python!! | mNTY pYTHON! | ‘Pyt’ |
hello | HLO | ell |
oh! | O! | oh! |
Create a program madlibs.py
that takes at least 6 parts of speech from the user as input, and outputs a story using those words. Your program should include at least one of each of the following parts of speech:
Each submission should be unique. You should not depend on any external files or modules (i.e., no imports); your program should be self-contained. If you choose to make use of any online resources, please include the URL in your comments and a brief description of how you used the resource to guide your implementation.
Once you’re satisfied that your programs are working correctly, zip it for submission:
project1_uLogin1.zip
Upload your zip file to Canvas.
Refactor > Rename