Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A-1. Create a list L1 containing numbers from 15 to 24 (24 exclusive), using LIST COMPREHENSION (do not use list function or usual FOR loop).

A-1. Create a list L1 containing numbers from 15 to 24 (24 exclusive), using LIST COMPREHENSION (do not use list function or usual FOR loop). Sort the list in ascending order. Create a new list L2 from L1 using LIST COMPREHENSION, where the elements of L1 and L2 are related as follows: (5 marks)

use python please and I need answers as text not photo so I can copy the code

image text in transcribed

A-2

Let B = [61, 25, 36, 21, 58, 101, 254, 200] be a list. Apply the following function ( 2 ( 2))//50 on each element of B. Don't use FOR loop!

A-1. Create a list L1 containing numbers from 15 to 24 (24 exclusive), using LIST COMPREHENSION (do not use list function or usual FOR loop). Sort the list in ascending order. Create a new list L2 from L1 using LIST COMPREHENSION, where the elements of L1 and L2 are related as follows: L2=[] for i, e in enumerate (L1): if e%2==1: if e>i: L2. append (e+i) else: L2. append (ei) A-2. Let B=[61,25,36,21,58,101,254,200] be a list. Apply the following function (x2 (x2))//50 on each element of B. Don't use FOR loop! (4 marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

7 4 . How do auditors evaluate the financial health of a company?

Answered: 1 week ago

Question

=+90 percent of all oil refineries) into several smaller companies

Answered: 1 week ago