Jun-03-2019, 12:55 PM
Hello Users,
I have my desired Tuple (see below) using the code mentioned. But I was wondering if there is any other clean way to obtain the same Output? (without using For/While Loops)
Desired Output:
((5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5))
Used Code:
I have my desired Tuple (see below) using the code mentioned. But I was wondering if there is any other clean way to obtain the same Output? (without using For/While Loops)
Desired Output:
((5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5), (5, 5, 5, 5, 5, 5))
Used Code:
Ar_tuple=() Mat_tuple=() i=0 while i<6: Ar_tuple=(Ar_tuple + (5,)) i=i+1 j=0 while j<6: Mat_tuple=((Mat_tuple)+(Ar_tuple,)) j=j+1 print(Mat_tuple)Best Regards