Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1269

Python • Re: Help with the code

$
0
0
Aside from
print("[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '1'), (9, '2'), (10, '3')]")
you could use

Code:

my_x_axses = [1,2,3,4,5,6,7,1,2,3]x_axces = []for idx,descriptor in enumerate(my_x_axses):    x_axces.append((idx+1, str(descriptor)))    print(x_axces)

Statistics: Posted by ghp — Fri Aug 30, 2024 12:13 pm



Viewing all articles
Browse latest Browse all 1269

Trending Articles