1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
gulaghasi [49]
4 years ago
11

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 2.25 Add a pair of parentheses to each expression so that it evaluates to True. (a) 0 == 1 == 2 (b) 2 + 3 == 4 + 5 == 7 (c) 1 < -1 == 3 > 4 For each expression, explain i
Computers and Technology
1 answer:
miskamm [114]4 years ago
3 0

Answer:

lst = [11, 603, 99, 7, 582, 1];

print("The index of the middle element: " + str(int(len(lst)/2)))

print("The middle element: " + str(lst[int(len(lst)/2)]))

lst.sort()

sorted_lst = lst.reverse()

print("The list in descending order: " + str(lst))

first_number = lst.pop(0)

lst.append(first_number)

print("New lst: "+ str(lst))

Explanation:

- Initialize a list

- Find the middle index, int(len(lst)/2)

- Find the middle element, lst[int(len(lst)/2)]

- Sort the list in descending order (First sort the list in ascending order than reverse it)

- Get the first element using <em>pop</em> method, and append it to the end using <em>append</em> method

- - - - -

a) 0 == 1 == 2 --> Always evaluates false

b) 2 + (3 == 4) + 5 == 7 --> Evaluates true

c) 1 < -1 == 3 > 4 --> Always evaluates false

You might be interested in
In the game of economics, producers look to technological improvements to increase which of the following?
Vaselesa [24]
They're looking to increase productivity 
7 0
3 years ago
Read 2 more answers
Whats in a computer?
kenny6666 [7]
A lot of things are in a computer there a motherboard, A cpu, A hard drive etc. A motherboard is the computer system  bascilly its the heart for a computer. The cpu is the the brain of a computer it controls on your computer and keeps it going good. finally a hard rive is the memory of your computer it stores all the data including files, photos, etc
8 0
3 years ago
Read 2 more answers
What is the definition of podcast
Yanka [14]

a digital studio that is been live to all around the world

6 0
3 years ago
How would you classify the earliest historical examples of STEM discoveries provided in this lesson?
Readme [11.4K]
MATHEMATICAL DISCOVERIES
4 0
4 years ago
Read 2 more answers
Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in
Firdavs [7]

Answer:

RTT1+ RTT2+..... RTTn

Explanation:

The total estimated time to get the IP address is

RTT1+ RTT2+..... RTTn

Once the IP address is known, O RTT elapses to set up the TCP connection and another O RTT elapses to request and receive the small object. The total response time is

2RTT0+RTT1+RTT2+.....RTTn

7 0
3 years ago
Other questions:
  • write a c++program that allows the user to enter the last names of fivecandidates in a local election and the number of votes re
    15·1 answer
  • What was the Messana conflict
    7·1 answer
  • You can use a 32-bit processor to install the hyper-v role as long as it supports virtualization extensions. true or false
    5·1 answer
  • You are the CISO of a company and you need to create logging policies. Please review NIST SP800-92, specifically sections 4–3 th
    12·1 answer
  • What does a proxy server do?
    5·2 answers
  • The Task Manager can be used ot track running _________________ .
    11·1 answer
  • Careers on the largest declining industries list will see an increase in the number of employees in their workforce.
    15·1 answer
  • Assume that strikeCounter has already been declared to be a "pointer to int". Assume further that strikeCounter has been initial
    5·1 answer
  • Recently, a serious security breach occurred in your organization. An attacker was able to log in to the internal network and st
    11·1 answer
  • Which section of a PCM is responsible for sending the proper reference voltage to many of the sensors?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!