subject

Atriangular 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 integer n, create a list of the first n triangular numbers. thus if n was 5, the list would be: [1, 3, 6, 10, 15]. associate the list with the variable triangulars.

2. an arithmetic progression is a sequence of numbers in which the distance (or difference) between any two successive numbers is the same. this in the sequence 1, 3, 5, 7, the distance is 2 while in the sequence 6, 12, 18, 24, the distance is 6. given the positive integer distance and the non-negative integer n, create a list consisting of the arithmetic progression between (and including) 1 and n with a distance of distance. for example, if distance is 2 and n is 8, the list would be [1, 3, 5, 7]. associate the list with the variable arith_prog.

3. given a variable temps that refers to a list, all of whose elements refer to values of type float, representing temperature data, compute the average temperature and assign it to a variable named avg_temp. besides temps and avg_temp, you may use two other variables -- kand total.

4. a list named parking_tickets has been defined to be the number of parking tickets given out by the city police each day since the beginning of the current year. (thus, the first element of the list contains the number of tickets given on january 1; the last element contains the number of tickets given today.) write some code that associates most_tickets with the largest value found in parking_tickets. you may, if you wish, use one additional variable, k. 5. associate the sum of the non-negative values in the list numbers with the variable sum.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 13:30
The source manager dialog box allows you to create sources, copy sources created and used in all the documents, modify sources an add bibliographic information to placeholders. true or false
Answers: 2
question
Computers and Technology, 22.06.2019 09:50
Assume that you have an sorted array of records. assume that the length of the array (n) is known. give two different methods to search for a specific value in this array. you can use english or pseudo-code for your algorithm. what is the time complexity for each algorithm and why?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
question
Computers and Technology, 23.06.2019 21:40
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
You know the right answer?
Atriangular number is a number that is the sum of the integers from 1 to some integer n. thus 1 is a...
Questions
Questions on the website: 13722359