79838646

Date: 2025-12-05 08:00:10
Score: 2
Natty:
Report link

@Marce Puente.... thanks, I exactly got what I was looking for by adding just a f string in your code :

import random
lst1 =[]
lst2 = []
lst3 = []
lst = [ lst1, lst2, lst3 ]

for i in range( 0, 3 ):
    for j in range( 1, 4 ):
        lst[ i ].append( random.randint( 1, 101 ))
    print( f"lst{i} = {lst[i]} ")

print( lst )

This gave me the output as below :

lst0 = [76, 35, 29]

lst1 = [85, 86, 94]

lst2 = [92, 41, 85]

[[76, 35, 29], [85, 86, 94], [92, 41, 85]]

Here I have the list names generated as well.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Marce
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: kirtyakshay