Create a python program that will:
Requirements:
Your commands should be case-insensitive
You should use python lists to store data
You should NOT use built-in python math functions, ormath libraries to compute these values
Tips:
Write one function that will convert a string withcomma-separated numbers into a python list with the numbers. Youcan use this in multiple other functions.
Don't name any of your functions \"min\", \"max\", or\"range\" or \"sum\". These are built-in functions.
Details
Load command details
Level 1 details (these functions work with the loadeddata list)
Level 2
median: show the median (middle value, or average of twomiddle values)
mode: show the mode, or modes
Level 3 details (these functions should use the firstnumber in the data list)
prime: determine if a number is prime
factorize: get the prime factors of anumber
fib: get the nth number in the fibonaccisequence
Here is my code so far:
#hehe my sum and stuff
f = open(\"input.txt\",'r')
def input(prompt=''):
print(prompt, end='')
return f.readline().strip() Â Â
#get data
def get_data():
pass
line = input().strip().split(',')
 Â
nums=[]
for n in line:
nums.append(float(n))
 Â
return nums
 Â
#get sum
def my_sum(data):
 Â
s=0
for n in data:
s += n
return s
 Â
pass
#get max
def my_max(data):
 Â
m=0
for n in data:
m >= n
return m
pass
#get min
def my_min(data):
 Â
i=0
for n in data:
i < n
return i
pass
#get range
def my_range(data):
r=0
for n in data:
m - i
return r
pass
#get mean
def mean(data):
e=0
for n in data:
????????
#get median
def median(data):
d=0
for n in data:
??????
 Â
#get mode
def mode(data):
o=0
for n in data:
???
 Â
#get prime
def prime(data):
p=0
for n in data:
???
#get factorization
def factorization(data):
f=0
for n in data:
????
 Â
#get fib
def fib(data):
b=0
for n in data:
??
#run it
def run_cli():
 Â
while(1):
cmd = input()
 Â
if cmd=='exit':
break
 Â
elif cmd=='get_data':
data = get_data()
print(data)
 Â
 Â
elif cmd=='my_sum':
s = my_sum(data)
print(s)
 Â
elif cmd=='my_max':
m = my_max(data)
print(m)
 Â
elif cmd=='my_min':
i = my_min(data)
print(i)
 Â
elif cmd=='my_range':
r = my_range(data)
print(r)
 Â
elif cmd=='mean':
e = mean(data)
print(e)
 Â
elif cmd=='median':
d = median(data)
print(d)
 Â
elif cmd=='mode':
o = mode(data)
print(o)
 Â
elif cmd=='prime':
p = prime(data)
print(p)
 Â
elif cmd=='factorization':
f = factorization(data)
print(f)
 Â
elif cmd=='fib':
b = fib(data)
print(b)
 Â
pass
#ha ahsbas
def main():
run_cli()
 Â
main()