Question: sumInputs.py Write a script that accepts an arbitrary number of user inputs. When you receive a user input value that is a number, add the

sumInputs.py

Write a script that accepts an arbitrary number of user inputs. When you receive a user input value that is a number, add the number to a growing sum of numbers received as user input. When you receive a user input value that is not a number, skip it. When you receive two consecutive user input values that do not number, stop accepting user inputs. Then Multiply the total number of user inputs received (numbers and non-numbers) times the growing sum of received numbers. Finally, print the result to the console as the last line.

This script should not print any other text to the console other than the result of the mathematical operation. Do not print any input prompt.

Example: input: 9 input: 1 input: 0 input: wicked input: 2 input: pepper input: salt

output: 84

sum = 12, total inputs = 7, 12 * 7 = 84

splitString.py

Write a script that accepts an arbitrary number of user inputs. Every time this script receives a string, it should add the string to a growing string. Newly added strings should be added to the growing string at the index equal to the newly added string's length. If the newly added string's length is equal to or larger than the growing string, this script should add the new string to the end of the growing string. When this script receives a blank input, this application should stop receiving input and print the growing string to the console.

This script should not print any other text to the console other than the result of the growing string. Do not print any input prompt.

Example: input: 'hello' -> growing string: 'hello' input: 'bear' -> growing string: 'hellbearo' input: 'cow' -> growing string: 'helcowlbearo' input: 'disestablishment' -> growing string: 'helcowlbearodisestablishment' input: '' -> growing string: 'helcowlbearodisestablishment'

output: 'helcowlbearodisestablishment'

numberGuess.py

You will create a script that allows a user to guess a hardcoded number you have picked. If the user's input is too high, you should print a message saying "the guess is too high", if the number is too low, you should print a message saying "the guess is too low". The first user input this script receives is going to be the total number of guesses that the user will have. All subsequent inputs will be guesses. If the user guesses the correct value print "correct" and the application should quit. If the user fails to guess the correct value within the specified number of guesses print, "you lose" then quit.

Programmatic Description: Pick a number between 1 and 10 hard code it in this script. Accept a user input, which will be a number; this inputted value is going to be the total number of attempts the user will have to guess the number. This number will be greater

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!