Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the program is pycharm Part I: Sum a Series of Values (10 points) Write a function sum_x_to_y() that takes the following arguments, in this order:

image text in transcribed the program is pycharm

Part I: Sum a Series of Values (10 points) Write a function sum_x_to_y() that takes the following arguments, in this order: 1. X: the lower bound of a series of integers to sum 2. y: the upper bound of a series of integers to sum Simply put, the function computes and returns the value of D + (x + 1) (x+2) + y Hint: use a range() expression, Examples: Function Arguments Return Value 1, 3 4, 10 49 5. 55 8, 30 -2, 6 18 Part II: Sum Multiples of 3 (10 points) Write a function sum_mults_of_3 that takes one argum nums: a list of integers CSE 101 - Spring 2020 The function computes and returns the sum of those Hint #1: Use the "for-each" syntax of for-loops. Hint #2: Inside your loop's body you will need to write an if-statement that checks if each number is a multiple of 3 and, if so, add it to a running total Examples: Return value " Function Arguments 118, -18, 17, -17, -1, 15, -12 (-18, -2, -9, 13, 0) [-12, -15, 7, -2, 4, -16,-1,-18, 19, -2, -17, -3) 10, 1, 16, 12, 9) -27 1-45

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions