mercredi 2 juin 2021

Is it available to detect print content in python? [duplicate]

Now we have a function number_print, which will print 0 or 1 randomly (but return None). Is it available to write another detect_printfunction like below?

def detect_print(number_print):
    if number_print 0:
        print('0 detected')
    if number_print 1:
        print('1 detected')

Aucun commentaire:

Enregistrer un commentaire