Ask Question
24 October, 18:45

Write a program that will generate 100 integers between 0 and 1000. Store the even numbers in a sorted linked list called evens. Store the odd numbers in a different sorted linked list called odds. Print the content of the evens and odds linked lists to the screen. Use the Linked_List class we developed in class.

+1
Answers (1)
  1. 24 October, 19:58
    0
    see explaination

    Explanation:

    import random

    def num_gen (s, e, n):

    r = []

    for j in range (n):

    r. append (random. randint (s, e))

    return r

    n = 100

    s = 0

    e = 1000

    l = num_gen (s, e, n)

    even_list = []

    odd_list = []

    for i in l:

    if i % 2 = = 0:

    even_list. append (i)

    else:

    odd_list. append (i)

    print ("Even List:", even_list)

    print ("Odd List:", odd_list)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program that will generate 100 integers between 0 and 1000. Store the even numbers in a sorted linked list called evens. Store the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers