#1.Run all blocks below by clicking block actions on the block below this and click run from this block
#2.Run this code block to choose what you want to do
function_grab()
# put code that you can run all block form top of notebook
def function_grab():
function=""
while function.lower() != 'done':
print("This notebook can do multiplcation, division, square's, square roots, volume, and Greatest common factors(GCF).\nType done to end program")
function=input('What do you need to do or type done to end program')
if function.lower() == 'multiply' or function.lower()=='multiplcation':
print('Ok i will call multiply')
multiply()
break
elif function.lower()== "divide" or function.lower()=='division':
print('Ok i will call divide')
divide()
break
elif function.lower()=="square":
print('ok I will call perfect square')
perfect_square()
break
elif function.lower()=='square root':
print('ok I will call square root')
square_root()
break
elif function.upper()=="VOLUME" or function.upper()== "VOL":
print("ok I will call volume of three dimensional's")
vol_of_three_dimensional()
return "done"
elif function.upper()=="GCF" or function.lower()=="greatest common factor":
print("ok I will cal greatest common factor")
GCF_function()
break
elif function.lower()=='done':
print('Program shuting down')
#created to help Multiply numbers
def multiply():
num_1=""
while num_1.lower() !="done":
num_1=input("Give me the first number or type Done to exit")
if num_1.isdigit():
num_2=input("Give Me the second number")
if num_2.isdigit():
print(num_1,"x",num_2,'=',int(num_1)*int(num_2))
else:
print('invalied input')
elif num_1 == "done":
print("Goodbye see you agian soon")
else:
print('Invalied input')
def divide():
num_1=""
while num_1.lower() !="done":
num_1=input("Give me the first number or type done to exit")
if num_1.isdigit():
num_2=input('Give me the second number')
if num_2.isdigit():
print(num_1,'/',num_2,'=',int(num_1)/int(num_2))
else:
print('Invalied input')
elif num_1.lower()=='done':
print('Goodbye see you agian soon')
else:
print('Invalied input')
#This is for squaring and square rooting numbers
def perfect_square():
number=""
while number.lower() != 'done':
number=input('Give me a number to square or type done to exit')
if number.isdigit():
print( pow(int(number),2))
elif number.lower()=="done":
print('Goodbye see you agian soon')
else:
print('invalied input')
import math
def square_root():
number=""
while number.lower() != 'done':
number=input('Give me a number to square root ot type done to exit')
if number.isdigit():
print(math.sqrt(int(number)))
elif number.lower()=='done':
print('Goodbye see you agian soon')
else:
print('Invalied input')
def vol_of_three_dimensional():
length=""
weith=""
height=""
radis=''
base=''
p_Height=""
big_Base=""
vol=""
pie=3.14159265359
type_of_prism=""
while type_of_prism != 'done':
print('Do you need vol of a rectangular prism, a trianglar prism, a cylinder, a pyramid, a cone, or a sphere:')
type_of_prism=input('What prism do you need to caculate volume for or type done to end program')
if type_of_prism.lower()=='rectangular' or type_of_prism.lower()=='cube':
base=input('Is the base a squere y/n:')
if base.lower()=='yes'or base.lower()=='y':
length=int(input("What is the base's length:"))
p_Height=int(input('What is the prisms height:'))
base=length*2
print('The volume is',base*p_Height)
else:
length=int(input('What is the Length of the base:'))
weith=int(input('What is the With of the base:'))
p_Height=int(input('What is the prisms height: '))
base=length*weith
print('The volume is', base*p_Height)
elif type_of_prism.lower()=='trianglar' or type_of_prism.lower()=='triangle':
base=int(input('What is the base of the triangle:'))
height=int(input('What is the height of the triangle:'))
p_Height=int(input('what is the prisms height'))
print("The volume is",(1/2*base*height)*p_Height)
elif type_of_prism.lower() =='cylinder':
radis=int(input('What is the radis of the base:'))
big_Base=pie*(radis*radis)
p_Height=int(input("What is the prisms height:"))
print('The volume is',big_Base*p_Height)
elif type_of_prism.lower()=='pyramid':
base=input('Is the base a trangle or a square')
if base.lower()=='triangle':
base=int(input("what is the base of the triangle"))
height=int(input('what is the height of the triangle'))
p_Height=int(input("What is the prism's height"))
big_Base=(1/2*base*height)
print("The volume is",1/3*big_Base*p_Height)
elif type_of_prism.lower()=="square":
length=int(input('What is the length of the base:'))
weith=int(input("what is the With of the base:"))
p_Height=int(input("what is the prism's height:"))
big_Base=length*weith
print("The volume is",1/3*big_Base*p_Height)
elif type_of_prism.lower()=="cone":
radis=int(input("what is the radis of the base:"))
big_Base=(pie*radis)*(pie*radis)
p_Height=int(input("what was the prism's height:"))
print("The volume is",1/3*big_Base*p_Height)
elif type_of_prism.lower()=='sphere':
radis=int(input("what is the radis"))
big_Base=(radis*radis)*radis
print("The volume is",4/3*pie*big_Base)
from math import gcd
def GCF_function():
number_count=''
while number_count.lower()!='done':
number_count=input("How many numbers do you want to check the GCF, or type done to end.\nThis can check between 2 and 6 numbers at a time")
num1=''
num2=''
num3=''
num4=''
num5=''
num6=''
gcf1=''
gcf2=''
gcf3=''
gcf4=''
if number_count.isalnum():
if number_count=='2':
num1=int(input('give me the 1st number'))
num2=int(input("give me the 2nd number"))
print("the GCF is",gcd(num1,num2))
elif number_count=='3':
num1=int(input('give me the 1st number'))
num2=int(input("give me the 2nd number"))
num3=int(input('give me the 3rd number'))
gcf1=int(gcd(num1,num2))
print("the GCF is",gcd(gcf1,num3))
elif number_count=='4':
num1=int(input('give me the 1st number'))
num2=int(input("give me the 2nd number"))
num3=int(input('give me the 3rd number'))
num4=int(input("give me the 4th number"))
gcf1=int(gcd(num1,num2))
gcf2=int(gcd(num3,num4))
print("the GCF is",gcd(gcf1,gcf2))
elif number_count=='5':
num1=int(input('give me the 1st number'))
num2=int(input("give me the 2nd number"))
num3=int(input('give me the 3rd number'))
num4=int(input("give me the 4th number"))
num5=int(input('give me the 5th number'))
gcf1=int(gcd(num1,num2))
gcf2=int(gcd(num3,num4))
gcf3=int(gcd(gcf1,gcf2))
print("the GCF is",gcd(gcf3,num5))
elif number_count=='6':
num1=int(input('give me the 1st number'))
num2=int(input("give me the 2nd number"))
num3=int(input('give me the 3rd number'))
num4=int(input("give me the 4th number"))
num5=int(input('give me the 5th number'))
num6=int(input("give me the 6th number"))
gcf1=int(gcd(num1,num2))
gcf2=int(gcd(num3,num4))
gcf3=int(gcd(num5,num6))
gcf4=int(gcd(gcf1,gcf2))
print("the GCF is",gcd(gcf3,gcf4))
elif number_count.lower()=="done":
print('Shutting down program')
else:
print('give me a number or type done')