dedicated to programmer_network
quote: "I never wanna write something like - if x is a string - again"Anonymous
python
07/04/2022 10:14 PM
788 B
28
Indexable
from time import sleep
string = sleep
def angry_if_not_string( string: str ):
'''my coworker will write here'''
no_string_flag = False
if not isinstance(string, str):
no_string_flag = True
while no_string_flag:
try:
string = string.to_string()
except:
print('what the')
try:
string = str(string)
except:
print('okay, we lost')
no_string_flag -= 0.5 # ;-)
return 'a ' + string
angry_if_not_string( string )Editor is loading...