Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program (special_sum.py) that calculate a special sum of 4 numbers, all int. The rule for this special sum is as follow: If

Write a Python program (special_sum.py) that calculate a special sum of 4 numbers, all int.

The rule for this special sum is as follow:

If one of the entered numbers is 17, then it does not count towards the sum and the numbers entered after it do not count.

For full credit, you must use function. Your function should have 4 int as parameters, and returns the special sum (as an int). Call this function specialsum and use main program:

if __name__ == "__main__":

as following:

Enter the first number: 1 Enter the second number: 2 Enter the third number: 17 Enter the fourth number: 5 You entered: 1, 2, 17 and 5 The special sum of the entered numbers is: 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions