Question: These are exercises in myprogramminglab for python and i think the simpler the code the better: 1.A triangular number is a number that is the

These are exercises in myprogramminglab for python and i think the simpler the code the better:

1.A triangular number is a number that is the sum of the integers from 1 to some integer n. Thus 1 is a triangular number because it's the sum of the integers from 1 to 1; 6 is a triangular number because it's 1+2+3=6.

Given the non-negative integers m and n (with m < n), create a list of the triangular numbers between (and including) m and n. Thus if m is 3 and n is 20, the list would be: [3, 6, 10, 15]. Associate the list with the variable triangulars.

2.Given the list lst of positive integers, associate the largest duplicated element with the variable max_dup. If the list contains no duplicates, associate -1 with max_dup .

3.Given that k refers to a non-negative int value and that t has been defined and refers to a tuple with at least k+1 elements, write an expression that evaluates to the kth element of t.

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!