Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TWO QUESTIONS - USE PYTHON LANGUAGE 3. Use the Design Recipe to write a function called runningTotal that repeatedly asks the user to input integers

TWO QUESTIONS - USE PYTHON LANGUAGE

3.

Use the Design Recipe to write a function called runningTotal that repeatedly asks the user to input integers at the keyboard until they type the word done. Print the sum of the values they entered. You may assume the user will only enter integers or "done".

For example:

Test Input Result
runningTotal() 3 5 done 8

10.

Given the following code:

def test(number, boolean): if number >= 90 and boolean: return "Tic" elif number >= 20: return "Tac" else: return "Toe" 

Write code that prints the result of calling the test function with each of the interesting 6 combinations of cases. Your code should end up printing:

Tic Tac Tac Tac Toe Toe 

Note: you should have exactly 6 lines of code in your submission, each one of the form

print(test(___, ___)) 

with values in the blanks.

The quiz server will match your output to the above AND print out of how many of the 6 interesting cases your tests covered.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions