Академический Документы
Профессиональный Документы
Культура Документы
def adder(first,second):
answer = first + second
return answer
value = adder(4,5)
print (value)
#2
def myprint(mystring):
print (mystring)
print (mystring)
return
myprint("bacon")
#3
import math
def pythagorean(a,b):
answer = math.sqrt(a**2 + b**2)
return answer
value = pythagorean(3,4)
print (value)
#4
import easygui
def mcq(choice1, choice2, choice3, choice4):
msg = "what is my name?"
title = "Survey"
choice = [choice1, choice2, choice3, choice4]
answer = easygui.choicebox(msg, title, choice)
return answer
#5
import math
def theSum(a,b,c,d,e):
answer = int(a + b + c + d + e)
return answer
#6
import math
def volumeOfSphere(radius):
return 4/3*(math.pi*radius**3)
value = volumeOfSphere(2)
print(value)
#7
def drakeEquation(R,fp,ne,fl,fi,fc,L):
return R*fp*ne*fl*fi*fc*L
value = drakeEquation(1,2,3,4,5,6,7)
print(value)