I have asked for a help, pls help me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I have asked for a help, pls help me

The problem is in my code bits https://code.sololearn.com/cN5rVMsRhOv9/?ref=app

12th Mar 2021, 4:13 PM
Swastik Patro
Swastik Patro - avatar
11 Answers
+ 3
why dont you create an empty list and append each for loop variable to it. example l = [] for element in string: #put your condition inside for loop if you have one l.append(element) print(l)
13th Mar 2021, 10:18 AM
iTech
iTech - avatar
+ 2
Are those inputs?
12th Mar 2021, 4:17 PM
Abhay
Abhay - avatar
+ 1
12th Mar 2021, 4:19 PM
Swastik Patro
Swastik Patro - avatar
+ 1
lis=[] lis.append("abc") ?? And please use tags for language relevant to question , not for asking questions.
12th Mar 2021, 4:22 PM
Abhay
Abhay - avatar
+ 1
abc is just the first element, I need a code to make it a list of other elements as well
12th Mar 2021, 4:26 PM
Swastik Patro
Swastik Patro - avatar
+ 1
n = int(input('how many string? ') list = [ input('string #'+str(i)+': ') for i in range (1,n+1) ] print(list) """ however, in sololearn, you must provide all inputs at once, each separated by a new line: 3 abc bcd def output: ['abc', 'bcd', 'def'] """
12th Mar 2021, 4:42 PM
visph
visph - avatar
+ 1
Thanks Ankit.. This is what I wanted..
14th Mar 2021, 10:44 AM
Swastik Patro
Swastik Patro - avatar
+ 1
https://www.sololearn.com/post/985319/?ref=app Someone help me please see my post ,I want to make working scope.....
14th Mar 2021, 12:42 PM
NOOR
NOOR - avatar
0
Swastik Patro what do you want to do?
12th Mar 2021, 4:20 PM
Abhay
Abhay - avatar
0
I have to put those outputs of a loop into a list of strings..
12th Mar 2021, 4:20 PM
Swastik Patro
Swastik Patro - avatar
0
Unable to get this, I am a beginner.
12th Mar 2021, 4:22 PM
Swastik Patro
Swastik Patro - avatar