Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Standard library code
#2
The i variable is the length of the string after terminal line feeds and carriage returns are taken out. So the s assignment on line 5 combines three things: the first five characters of the original s, a number of asterisks (*) equal to the length of the original s (not counting the first five characters or any terminal LF/CR), and any terminal LF or CR from the original s. It's a way of preserving those terminal characters, if they exist.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Standard library code - by BerryK - Apr-29-2017, 09:36 PM
RE: Standard library code - by ichabod801 - Apr-29-2017, 10:16 PM
RE: Standard library code - by Larz60+ - Apr-29-2017, 10:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python best library for Excel reports & review of existing code MasterOfDestr 4 1,005 Feb-14-2024, 03:39 PM
Last Post: MasterOfDestr
  python standard way of importing library mg24 1 974 Nov-15-2022, 01:41 AM
Last Post: deanhystad
  Catching a crash within a library code ebolisa 9 3,329 Nov-22-2021, 11:02 AM
Last Post: bowlofred
  How do I open the Source code of a library? JaneTan 1 2,361 Aug-18-2021, 02:12 AM
Last Post: Larz60+
  Winsorized Mean and Standard Deviation Wheeliam 0 1,874 Jul-11-2020, 05:27 PM
Last Post: Wheeliam
  standard library modules chpyel 4 2,927 May-10-2020, 02:58 PM
Last Post: snippsat
  Is there a standard for autocommit In PEP 249 zatlas1 10 5,471 Feb-06-2019, 04:56 PM
Last Post: buran
  Graphics and standard deviation rocioaraneda 3 2,803 Jan-09-2019, 10:53 PM
Last Post: micseydel
  standard data types rombertus 3 77,143 Dec-23-2018, 08:52 PM
Last Post: rombertus
  Join the Python Standard Library to my project sylas 1 2,243 May-16-2018, 05:59 AM
Last Post: buran

Forum Jump:

User Panel Messages

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