For this lab, and every lab: comment your code. If you use/adapt code from the internet, you must add a comment with the source of the code.
Reading: Chapter 3 https://automatetheboringstuff.com/2e/chapter3/
Activity – Python Tutor: Try at least one program in Python Tutor http://www.pythontutor.com/
Question 1: Greetings Function! (4 points)
Start with the greeting program, the first program with functions we used in Python Tutor. This time, the computer is very happy to meet you. Modify the function to return the user’s name in uppercase, with !!!! after it. So, if the user’s name is Miriam, the greeting function will return ‘HELLO MIRIAM!!!!’
Question 2: Quiz question function (6 points)
Write a function that takes two arguments – a quiz question and the correct answer.
In your function, you will print the question, and ask the user for the answer. If the user gets the answer correct, print a success message. Else, print a message with the correct answer. Your function does not need to return anything.
Call your function with two example quiz questions. Here’s some suggestions,
Question 3: Windows 10 Upgrade (10 points)
When installing Windows 10, a user can either wipe everything from their computer and do a clean install. Or if their computer meets system requirements, the user can upgrade to Windows 10 without erasing their current operating system.
To do the upgrade, according to Microsoft, a computer needs to have at least 1GB of memory, and at least 1GHz processor, and either Windows 7 or Windows 8 currently installed. All three requirements must be met.
Write a program that asks the user for
Write a can_upgrade function that takes three arguments, the amount of memory, the processor speed, and current operating system.
In can_upgrade, use conditions to figure out if the user’s computer can be upgraded to Windows 10 or not. Your function should return one of the Boolean values True (if the computer can be upgraded) or False (if it can’t be upgraded).
Call your can_upgrade function from main(), and use the return value to print a message to the user telling them if they can, or can’t, upgrade.
Extra Credit Question: (+5 points)
Start with the College ID card program from https://gist.github.com/claraj/b993219477d015d58341c4f3c1950a22. This has no functions but it would benefit from being re-organized into functions. Refactor this program. Suggestions – functions for validation, functions to help print the college ID card, for example printing a line of —-, printing centered text, printing text in color.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more