Question: 1. 2. Triangular Numbers :A triangular number is any number from the series of numbers (1, 3, 6, 10, 15, etc.) obtained by continued summation

1.

2. Triangular Numbers :A triangular number is any number from the series of numbers (1, 3, 6, 10, 15, etc.) obtained by continued summation of the natural numbers 1, 2, 3, 4, 5, etc.1 Implement a function next triangular number(num) that takes an integer and determines the smallest triangular number that is equal to or larger than the given number. The function must: take one argument: a positive integer, num return trig num, where trig num is the smallest triangular number that is greater than or equal to num use a while-loop

Example: calling next triangular number(25) returns 28 as the triangular number 21 (1+2+3+4+5+6 = 21) is smaller than 25, and so the next triangular number 28 (1 + 2 + 3 + 4 + 5 + 6 + 7 = 28), which is bigger than 25, is the next triangular number in the series.

3.Implement a function flip(binary string) that takes a binary string (a string containing only 1s and 0s) and returns a new string where every bit has been ipped. (E.g. calling flip('001011') returns '110100'.)

4.Implement a function remove outliers(table) that takes as input an nm table of numbers. The function replaces every instance of the maximum and minimum value with the midway-point of the maximum and minimum, and returns the altered table.

Example: calling remove outliers([[0,4],[2,4],[-1,3]] would return [[0,1.5],[2,1.5],[1.5,3]] because the maximum value was 4, the minimum value was -1, and the midway point of -1 and 4 is 1.5. Thus all instances of 4 and -1 were replaced with 1.5.

5.Implement a function addition table(numbers) that takes a list of n numbers and returns an n 3 table where the rst row contains the given numbers plus 1, the second row contains the given numbers plus 2, and the third row contains the given numbers plus 3.

Example: calling addition table([2,5,-3,7]) returns [[3,6,-2,8],[4,7,-1,9],[5,8,0,10]].

6.Implement a function partial sum(start, end, step) that takes three integers and returns the partial sum of a sequence. The function will return the sum of the sequence of numbers that starts at start, ends at end (inclusive), and goes up by step

7.Implement a function reverse strings(my list) that takes a list of strings, and returns the strings concatenated in reverse order. You may not use the method reverse. You may destroy the input list in the process.

How to solve the seven questions with python 3.8 I find them really difficult

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 Programming Questions!