Write a statement that declares a variable named mascot of type str and assigns it the value "Jorge"
Write a statement that invokes the print function to print the value of the variable mascot
Write the declaration for a function called aDayInTheLife that takes in one parameter named celebrity of type str and returns a str
Complete the definition for the function by writing the body:
Write a statement that declares a variable named activity of type str and assigns it the concatenation of the parameter name and the string literal " honks"
Write a return statement to return the value of the variable activity
Write a statement that invokes the function aDayInTheLife on the variable mascot
Modify your previous statement so that it invokes the function aDayInTheLife on the variable mascot and assigns the returned value to a variable mascotDay of type str
Write a statement that invokes the print function to print out mascotDay
Write a statement that declares a variable named mascot of type str and assigns it the value "Jorge"
mascot:str = "Jorge"
Write a statement that invokes the print function to print the value of the variable mascot
print( mascot )
Write the declaration for a function called aDayInTheLife that takes in one parameter named celebrity of type str and returns a str
def aDayInTheLife( celebrity:str ) -> str:
Complete the definition for the function by writing the body:
Write a statement that declares a variable named activity of type str and assigns it the concatenation of the parameter name and the string literal " honks"
Write a return statement to return the value of the variable activity
def aDayInTheLife( celebrity:str ) -> str:
activity:str = celebrity + " honks"
return activity
Write a statement that invokes the function aDayInTheLife on the variable mascot
aDayInTheLife( mascot )
Modify your previous statement so that it invokes the function aDayInTheLife on the variable mascot and assigns the returned value to a variable mascotDay of type str
mascotDay:str = aDayInTheLife( mascot )
Write a statement that invokes the print function to print out mascotDay
print( mascotDay )
Write a statement that declares a variable named numGeese of type int and assigns it the value 1
Write a statement that invokes the print function to print the value of the variable numGeese
Write the declaration for a function called adoptGoslings that takes in two parameters named numCanadianGoslings of type int and numPilgrimGoslings of type int and returns an int
Complete the definition for the function by writing the body:
Write a statement that declares a variable named numGoslings of type int and assigns it the sum of the two parameters
Write a return statement to return the value of the variable numGoslings
Write a statement that invokes the function adoptGoslings on the values 5 and 2
Modify your previous statement so that it invokes the function adoptGoslings on the values 5 and 2, sums the returned value with the variable numGeese and assigns the result to the variable numGeese
Write a statement that invokes the print function to print out the updated value of numGeese
Write a statement that declares a variable named numGeese of type int and assigns it the value 1
numGeese:int = 1
Write a statement that invokes the print function to print the value of the variable numGeese
print(numGeese)
Write the declaration for a function called adoptGoslings that takes in two parameters named numCanadianGoslings of type int and numPilgrimGoslings of type int and returns an int
def adoptGoslings( numCanadianGoslings:int, numPilgrimGoslings:int ) -> int:
Complete the definition for the function by writing the body:
Write a statement that declares a variable named numGoslings of type int and assigns it the sum of the two parameters
Write a return statement to return the value of the variable numGoslings
def adoptGoslings( numCanadianGoslings:int, numPilgrimGoslings:int ) -> int:
numGoslings:int = numCanadianGoslings + numPilgrimGoslings
return numGoslings
Write a statement that invokes the function adoptGoslings on the values 5 and 2
adoptGoslings( 5, 2 )
Modify your previous statement so that it invokes the function adoptGoslings on the values 5 and 2, sums the returned value with the variable numGeese and assigns the result to the variable numGeese
numGeese = numGeese + adoptGoslings( 5, 2 )
Write a statement that invokes the print function to print out the updated value of numGeese
print(numGeese)