Function, type()


#1

Can someone explain the exercise where you have to do an int, float and str. e.g how are they formatted.

Thanks


#2

Please add a link to the exact exercise that you are asking about.


#3

this exercise below tried to run my code but no joy

First, def a function, shut_down, that takes one argument s. Don't forget the parentheses or the colon!

  1. Then, if the shut_down function receives an s equal to "yes", it should return "Shutting down"

  2. Alternatively, elif s is equal to "no", then the function should return "Shutdown aborted".

  3. Finally, if shut_down gets anything other than those inputs, the function should return "Sorry"


#4

Hi, the instructions says.

First, def a function, shut_down, that takes one argument s. Don't forget the parentheses or the colon

def shut_down(s):

1 Then, if the shut_down function receives an s equal to "yes", it should return "Shutting down", this part should be inside the shut_down function

if s == "yes":
    return  "Shutting down"

2

Alternatively, elif s is equal to "no", then the function should return "Shutdown aborted"

elif s == "no":
   return  "Shutdown aborted"

3
Finally, if shut_down gets anything other than those inputs, the function should return "Sorry", this one is the else statement

else:
    return "Sorry"

Then you should call the function shut_down
with a string or "yes" and "no"


#5

thanks I've done it.