• @ArtVandelay
    link
    English
    11
    edit-2
    2 months ago
    def hot(temp: int = 340):
        return temp
    

    That way Bev can define temp however she needs, but if Picard doesn’t specify, he gets his tea at a nice drinkable Kelvin temp.

      • @ArtVandelay
        link
        English
        82 months ago

        Python is dynamically typed, so you could just go against the type hint like an animal. But yes, probably.

    • Echo Dot
      link
      fedilink
      22 months ago

      If you’re just going to define a variable and then return it there’s no reason to do it in a function.