23 Nov Friday Python Practice 20:30 – 22.11.18
Posted at 22:03h in Friday 19:30 Homework 0 Comments
Write a function luckySum(a, b, c) to calculate sum of given 3 int values, a b c. The function will have a return value of their sum. However, if one of the values is 13 then it does not count towards the sum and values to its right do not count. So for example, if b is 13, then both b and c do not count.
Sample Input 1:
Sample Output 1
The lucky sum is 6
Sample Input 2:
Sample Output 2:
The lucky sum is 3
(Because c is 13, c does not count towards the sum)
Sample Input 3:
Sample Output 3
The lucky sum is 1
(Because b is 13, both b and c does not count towards the sum)
Sorry, the comment form is closed at this time.