-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPractice.py
More file actions
35 lines (25 loc) · 894 Bytes
/
Practice.py
File metadata and controls
35 lines (25 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
##################################
# Created by Flavia Morgulis
# Aug 2025
# Homepractice random
###################################
import random
###############################################################################
# Main Code #
###############################################################################
numbers = []
num_count = int(input("How many numbers do you want to generate? "))
lowest = float(input("Enter the lowest value: "))
highest = float(input("Enter the highest value: "))
for i in range(num_count):
rand_num = random.uniform(lowest, highest)
numbers.append(rand_num)
total = 0
for num in numbers:
total += num
mean = total / num_count
print("\nGenerated numbers:")
for num in numbers:
print(num)
print(f"\nTotal of numbers: {total}")
print(f"Mean of numbers: {mean}")