Write a Python program that creates a set of ten elements with random numbers between 1 and 100, and then prints out the values in sorted order
Dear Student,
below i have written the complete python code as per the requirement.
==============================================================
Program:
==============================================================
import random
#create an empty list
numbers = []
#loop through 10 times
for i in range(10):
#generate a number between 1 and 100
num = random.randint(1, 100)
#append the number into list
numbers.append(num)
#sort the numbers
numbers.sort()
#print the sorted numbers
print(numbers)
============================================================
Screen shot of the code

=============================================================
Sample Output:

=============================================================
Kindly Check and Verify Thanks...!!!
Write a Python program that creates a set of ten elements with random numbers between 1...
Create a program that creates an array of 500 random numbers between -10 and 10. Write several functions: Function 1 - prints the array with a certain number of elements per line. Prototype: void printArray(int array[], int numElements, int numPerLine, ostream &os) Function 2 prints only the array elements that are evenly divisible by an input number. Prototype: void printDivBy(int array[], int numElements, int numPerLine, int divBy, ostream &os) Function 3 takes the input array and returns the maximum, the...
Write a Python function that creates and returns a list of prime numbers between 2 and N, inclusive, sorted in increasing order. A prime number is a number that is divisible only by 1 and itself. This function takes in an integer and returns a list of integers.
Write a program that takes a list of integer numbers from a user and creates a new sorted in ascending order list. As output you need to print original list and sorted one. use list and while python
Write a program in C that creates an array of 100 random numbers from 0-99. The program sums the random numbers and prints the sum. It then writes the numbers to a new file using open, close and write. Then looks in the current directory for files that match the pattern “numbers.XXXX”. For each file, open the file and read the file. You can assume that the file will contain 100 integers. Sum the integers. Print the filename and the sum...
Write a Java program that creates a random array of 10 with numbers ranges between 1 and 25.
In PYTHON Write a program that # 1) Creates a list of 25 numbers that are all different # 2) Takes a user-input number and then determines which number in the list is closest to the user-input number.
Write a python program that creates a set with twelve things. Use a looping structure to enter the values. Then enter three things in another set and see if any things are in common
Write a function in PYTHON that reads a sequence of numbers ended by 0 and prints “Sorted” if the numbers were input in increasing or decreasing order, otherwise the program must print “Not sorted” (Do not calculate 0) Sample Input 4 3 -1 -5 0 Sample Output Sorted
Exercise 22: Write a program that creates three random double variables a, b, and c and assigns them values between 0 and 1 using the Math.random( ) method mentioned in the preceding exercise. It then does all of the following: It prints out the three values. It prints "All are tiny" if all three values are less than 0.5. Extra: It prints out "One is tiny" if exactly one of the three values is less than 0.5. Extra: It prints...
Explain the code: Exercise 22: Write a program that creates three random double variables a, b, and c and assigns them values between 0 and 1 using the Math.random( ) method mentioned in the preceding exercise. It then does all of the following: It prints out the three values. It prints "All are tiny" if all three values are less than 0.5. It prints out "One is tiny" if exactly one of the three values is less than 0.5. It...