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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started