Python Forum
"Slicing and dicing strings" - - PyBite #105
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Slicing and dicing strings" - - PyBite #105
#4
In addition to what was previously said. Note that you are aware that
new_line_split
is a List type, are you sure that lists have the strip method? Also
Quote:- strip the trailing dot (.) and exclamation mark (!) from this last word,
key here is the last word, If I want to know the last word of the new_line how would I do so. This is a list after all. documentation on string methods. also look for documentation on List methods, where does strip come from.

In addition id like to mention, I often spend time playing in the python repl and like to make discoveries of what methods are available to me for certain types, sometimes I forget or because I deal with multiple languages, I need to refresh my memory, I will use things like dir(str) or dir(dict) ... on various types
Reply


Messages In This Thread
RE: "Slicing and dicing strings" - - PyBite #105 - by knackwurstbagel - Jun-04-2020, 07:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dictionary lookups exercise (PyBite #109) Drone4four 14 6,326 Aug-10-2020, 06:41 PM
Last Post: Intr0spective
  Type conversion and exception handling (PyBite #110) Drone4four 5 39,610 Jul-27-2020, 11:33 AM
Last Post: DeaD_EyE
  Iterating over dictionaries with the namedtuple function (PyBite #108) Drone4four 7 5,033 Jul-15-2020, 04:23 AM
Last Post: ndc85430
  Strings inside other strings - substrings OmarSinno 2 3,792 Oct-06-2017, 09:58 AM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

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