Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Average #55

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions functions/Average.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

def calc(should_print=False):

print("""
Name: Average
Operation : Average of given number
Inputs :(a,b,c.....n)->int/float ,total no ->int
Outputs: Avg=>(a+b+...n)/total_no ->float
Author : Anand76666
\n
""")


Total_list=[]
total_no = int(input("Enter the total no inputs :"))
for i in range (0,total_no):
print("Enter the no",i+1,":")
b=int(input())
Total_list.append(b)
print("Average of given inputs :",sum(Total_list) / len(Total_list))

result = {}
result['inputs'] = [Total_list]
result['outputs'] = [sum(Total_list) / len(Total_list)]


if should_print:
print("Solution {result['outputs'][0]}")
else:
return result

calc()

24 changes: 24 additions & 0 deletions functions/Exponet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
def calc(should_print=False):

print("""
Name: Exponent
Operation : Exponential of 2 numbers
Inputs : a->int/float , b->int/float
Outputs: c=>a**b ->float
Author : Anand76666
\n
""")

a = float(input("Enter a >>"))
b = float(input("Enter b >>"))
print("Solution {a**b}>>",a**b)

result = {}
result['inputs'] = [a, b]
result['outputs'] = [a ** b]

if should_print:
print("Solution {result['outputs'][0]}")
else:
return result
calc()
Binary file added functions/__pycache__/Exponet.cpython-38.pyc
Binary file not shown.
Binary file modified functions/__pycache__/add.cpython-38.pyc
Binary file not shown.
Binary file modified functions/__pycache__/div.cpython-38.pyc
Binary file not shown.
Binary file modified functions/__pycache__/mul.cpython-38.pyc
Binary file not shown.
Binary file modified functions/__pycache__/quadratic-solver.cpython-38.pyc
Binary file not shown.
Binary file modified functions/__pycache__/sigmoid.cpython-38.pyc
Binary file not shown.
Binary file modified functions/__pycache__/sub.cpython-38.pyc
Binary file not shown.
27 changes: 27 additions & 0 deletions functions/avg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
def calc(should_print=False):

print("""
Name: Average
Operation : Average of given number
Inputs :(a,b,c.....n)->int/float ,total no ->int
Outputs: A=>(a+b+...n)/total_no ->float
Author : Anand76666
\n
""")


Total_list=[]
total_no = int(input("Enter the total no inputs :"))
for i in range (0,total_no):
print("Enter the no",i+1,":")
b=int(input())
Total_list.append(b)
print("Average of given inputs :",sum(Total_list) / len(Total_list))


if should_print:
print("Solution {result['outputs'][0]}")
else:
return 0;

calc()