Python Random Practice Questions


  1. What possible outputs(s) will be obtained when the following code is executed?

    import random
    myNumber = random.randint(0, 3)
    COLOR = [ "YELLOW", "WHITE", "BLACK", "RED" ]
    for I in range(1, myNumber):
          print(COLOR[I], end="*")
          print( )
    
  2. WHITE*
    
    or
    
    WHITE*
    BLACK*
    
    or
    
    No Output