The function runs a random number of times. How to judge that the current operation is the last time

The

function runs randomly. How to determine whether the current run is the last
def a ():

pass

iTun0
while random number:

a()
Mar.06,2021

def a():
    pass

i=0
while :
    a()
// 
a()
Menu