Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Task 3: Random number sorting Algorithm Use the random python library to generate 100 pseudo random values from 20 to O and save it to

image text in transcribed
Task 3: Random number sorting Algorithm Use the random python library to generate 100 pseudo random values from 20 to O and save it to a list. Use the following code to sort out this list from lowest to est. Remember that there is a random.randint(x,y+1) function where you can use. Yet there is something important to use as well besides this radint(x,y+1). Hint there is a requirement to do this with time and seed. import random #my bubble sorting Algorithm function def bsort(Ist): n len(Ist) temp. i = 0,0 while in j=1 while j Ist[i]: temp = Ist/-1) Ist[j- 1] = Isti Istol = temp 141 return ist Task 4: Commissions Sales Force Inc. needs help calculating sales commissions. Its salesmen always report their sales figures in groups of 3 and each sale is always priced differently. Some salesmen are gaming the system and reporting the same sale twice. In order to prevent this, management wants you to write a function that takes 3 integer values abe) as parameters and returns their sum. However, if one of the values is the same as another of the values, it does not count towards the sum. Example: Enter in 3 values on one line>>> 2 3 4 Your sum is Enter in 3 values on one line>> 1 14 your sum is<:>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions