Hello,
I am a beginner in Phyton. It is a very basic question I guess, but pls help me anyway :)
--> I would like to add the new list to listA. I know the name is in a, but if I put a in, the string gets added to listA and not the new list.
What do I have to put inside the brackets?
Cheers
I am a beginner in Phyton. It is a very basic question I guess, but pls help me anyway :)
1 2 3 4 |
listA = [] a = input () globals ()[a] = [] #generates a new list with the name of the input string listA.append(????????) #question |
What do I have to put inside the brackets?
Cheers
Larz60+ write Jun-16-2021, 03:13 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.