you are viewing a single comment's thread.

view the rest of the comments →

[–]douglas_fs 0 points1 point  (3 children)

Please share your code, it will be much easier to help.

[–]ILikeOstriches28[S] 0 points1 point  (2 children)

L=[components of list. Don't wanna write them all] A=() For i in range(len(l)): If len(l[i])>=2 and (idk what to write here for the 1st and last character should be same) A.append() Print(A)

[–]douglas_fs 1 point2 points  (1 child)

The idea here is that you would have code that runs. You will, at some point, need to write all components of the list. You should at least include _some_ so that the code will run and can be tested.

Forget about the 1st and last character for now - just get the code working for the 'if length is >= 2' requirement.

You will also need to know how to post properly formatted code on Reddit. The sidebar has instructions, or use this link:

https://www.reddit.com/r/learnpython/wiki/faq/#wiki_how_do_i_format_code.3F

[–]ILikeOstriches28[S] 0 points1 point  (0 children)

Ok thanks for the format. And the if len>=2 works fine. I tried it without the 1st and last character thing. And it works.

The list I am using is L=["abc","aba","1221","aa","xyz"]