Computers and Technology

Write python expressions corresponding to these statements:

2.22 write an expression involving string s containing the last and first name of a person— separated by a blank space—that evaluates to the person’s initials. if the string contained my first and last name, the expression would evaluate to 'lp'.

2.23 the range of a list of numbers is the largest difference between any two numbers in the list. write a python expression that computes the range of a list of numbers lst. if the list lst is, say, [3, 7, -2, 12], the expression should evaluate to 14 (the difference between 12 and -2).

2.24 write the relevant python expression or statement, involving a list of numbers lst and using list operators and methods for these specifications:

(a) an expression that evaluates to the index of the middle element of lst

(b) an expression that evaluates to the middle element of lst

(c) a statement that sorts the list lst in descending order

(d) a statement that removes the first number of list lst and puts it at the end

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, ghazanfarwaheed7967
Auniversity wants to install a client-server network. which feature do you think is important for them as they set up the network? sending email blocking multiple people to use the same file low security low set up cost limited access to files
Answers: 1
image
Computers and Technology, 22.06.2019 22:40, ihatemylife0
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, shadowsnake
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible. restrictions: branches or loops should not be used. the code must use the internal mod and logical functions. hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible. this is matlab
Answers: 2
image
Computers and Technology, 23.06.2019 11:30, kieante01
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
Do you know the correct answer?
Write python expressions corresponding to these statements:

2.22 write an expression i...

Questions in other subjects: