I have a list:
L = [1, 2, 3, 4, 5, 6]
and I want to print
1 B 2 J 3 C 4 A 5 J 6 X
from that list.
How do I do that?
Do I have to make another list and zip them up, or is there some way I can have the letters in my format specifier?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A nice way to do this is have a dictionary of numbers to prefixes:
Then you can do:
If you also have a list of letters: