#Km91# to TenForward: Where Every Vulcan Knows Your Name • 2 months agoMachine learningsh.itjust.worksimagemessage-square42fedilinkarrow-up1670arrow-down111
arrow-up1659arrow-down1imageMachine learningsh.itjust.works#Km91# to TenForward: Where Every Vulcan Knows Your Name • 2 months agomessage-square42fedilink
minus-square@ArtVandelaylinkEnglish11•edit-22 months agodef 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.
minus-square@ArtVandelaylinkEnglish8•2 months agoPython is dynamically typed, so you could just go against the type hint like an animal. But yes, probably.
minus-square@[email protected]linkfedilink0•2 months agoIf you want to write Python like a caveman, then sure
minus-squareEcho Dotlinkfedilink2•2 months agoIf you’re just going to define a variable and then return it there’s no reason to do it in a function.
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.
Shouldn’t that be a float?
Python is dynamically typed, so you could just go against the type hint like an animal. But yes, probably.
If you want to write Python like a caveman, then sure
If you’re just going to define a variable and then return it there’s no reason to do it in a function.