Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

lists in python i want each element of B_list to be A_list - 5 import random #A list = 20 random number eg (5,15,34,50,....) A=20

lists in python

i want each element of B_list to be A_list - 5

import random

#A list = 20 random number eg (5,15,34,50,....) A=20 A_list=[] for i in range (A): c=random.randrange(0,50,1) A_list.append(c) print(A_list)

#B_list should = A list - 5 #eg : if A_list = (10,20,30) #B_list should be (5, 15, 25) B_list=[] for i in range(A): c=([i]in A_list)-5 B_list.append(c) print(B_list)

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

More Books

Students also viewed these Databases questions

Question

Distinguish between poor and good positive and neutral messages.

Answered: 1 week ago

Question

Describe the four specific guidelines for using the direct plan.

Answered: 1 week ago