Write a complete Python script that takes three numbers and reports the following:
Please enter a number: 11.1 Please enter a number: 222.2 Please enter a number: 3333.3 The smallest number is 11.1 The largest number is 3333.3 The average is 1188.9 The two numbers that are the closest are 11.1 and 222.2
Please enter a number: 3.14159 Please enter a number: 1.41421 Please enter a number: 2.71828 The smallest number is 1.41421 The largest number is 3.14159 The average is 2.4 The two numbers that are the closest are 3.14159 and 2.71828
handin pe18a pe18a.pyTo verify your submission, type the following in a terminal window:
handin pe18a
Write a complete Python script that requests the name of an input file, reads in its contents of the input file, and writes the lines in reverse order.
I am part of a lost generation. And I refuse to believe that I can change the world. I realize this may be a shock, but "Happiness comes from within" Is a lie, and "Money will make me happy" So in thirty years, I will tell my children They are not the most important thing in my life. My employer will know that I have my priorities straight because Work Is more important than Family I tell you this: Once upon a time Families stayed together But this will not be true in my era. This is a quick fix society Experts tell me Thirty years from now, I will be celebrating the tenth anniversary of my divorce. I do not concede that I will live in a country of my own making. In the future, Environmental destruction will be the norm. No longer can it be said that My peers and I care about this Earth. It will be evident that My generation is apathetic and lethargic. It is foolish to presume that There is hope.The following is an example of correct execution (with the text in bold being the input from the user):
Please enter the name of the input file: theLostGeneration.txt There is hope. It is foolish to presume that My generation is apathetic and lethargic. ... And I refuse to believe that I am part of a lost generation.
handin pe18b pe18b.pyTo verify your submission, type the following in a terminal window:
handin pe18b