Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble in lists
#3
(Feb-25-2019, 11:20 AM)erfanakbari1 Wrote: 1.Convert the string to list.
2.Display the first element and last element of list.
3.Display the elements except first and last elements in the list.
4.Display the length of the list.
5.Convert the list back to string and display them.
6.Convert the string to list with respect to spaces i.e ['hello','world'] for input 'hello world'

1. Use one of built-in functions
2. Use subscription
3. Use slicing
4. Use one of built-in functions
5. Use one of built-in functions
6. Use one of string methods

Python names are quite descriptive therefore finding needed on should be quite simple.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
Trouble in lists - by erfanakbari1 - Feb-25-2019, 11:20 AM
RE: Trouble in lists - by Larz60+ - Feb-25-2019, 03:47 PM
RE: Trouble in lists - by perfringo - Feb-26-2019, 08:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trouble displaying items from lists Liquid_Ocelot 8 6,587 May-18-2017, 01:37 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020