dedicated to programmer_network
quote: "I never wanna write something like - if x is a string - again"unknown
python
3 years ago
589 B
15
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...