1 Using Python Create 20 Random Integers Array Numbers 1 100 Includes 1 100 Pick Sort Fir Q37022920

1-Using Python, Create 20 random integers in an array which hasthe numbers between 1 and 100 (includes both 1 and 100). Pick andsort first the even numbers then the odd numbers in ascending orderand print the final array. (i.e. [1 3 51 77 4 12 44 82])


Answer


main.py 1 import random 2nums-[random.randint (1, 100) for_in range (20) 3 oddNums- [n for n in nums if n % 2 :-1] https://Wr

import randomnums = [random.randint(1, 100) for _ in range(20)]oddNums = [n for n in nums if n % 2 == 1]evenNums = [n for n in

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.