Python Forum
Print string in a single line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print string in a single line
#9
(Nov-08-2019, 08:52 AM)RavCOder Wrote: I maybe I think that they refered a string is immutable like a list (then I don't know if this is correct or not).

Strings are immutable and list are mutable
sequences.

I recommend to read documentation: Sequence Types — list, tuple, range

Quote:There are three basic sequence types: lists, tuples, and range objects. Additional sequence types tailored for processing of binary data and text strings are described in dedicated sections.

There are described Common Sequence Operations, Mutable and Immutable Sequences, and Text Sequence types.

Strings and lists are iterable.

Difference between sequence and iterable can be described as: sequence has order i.e. one can access items by index (str, list, tuple, range) but iterable is capability to return one item at the time and therefore supports in addition to sequences un-ordered datastructures like sets as well.

But in no circumstances one should consider string as list.
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
Print string in a single line - by RavCOder - Nov-07-2019, 03:02 PM
RE: Print string in a single line - by baquerik - Nov-07-2019, 03:05 PM
RE: Print string in a single line - by RavCOder - Nov-07-2019, 03:10 PM
RE: Print string in a single line - by RavCOder - Nov-07-2019, 04:28 PM
RE: Print string in a single line - by ichabod801 - Nov-07-2019, 03:06 PM
RE: Print string in a single line - by perfringo - Nov-08-2019, 07:50 AM
RE: Print string in a single line - by RavCOder - Nov-08-2019, 08:52 AM
RE: Print string in a single line - by perfringo - Nov-08-2019, 09:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with spliting line in print akbarza 3 406 Jan-23-2024, 04:11 PM
Last Post: deanhystad
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 12,589 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Need help on how to include single quotes on data of variable string hani_hms 5 2,054 Jan-10-2023, 11:26 AM
Last Post: codinglearner
  python sql query single quote in a string mg24 1 1,082 Nov-18-2022, 08:01 PM
Last Post: deanhystad
  Print the line before the corrent line tester_V 9 1,578 Nov-18-2022, 08:39 AM
Last Post: Gribouillis
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,388 Sep-27-2022, 01:38 PM
Last Post: buran
  Remove a space between a string and variable in print sie 5 1,800 Jul-27-2022, 02:36 PM
Last Post: deanhystad
  Inserting line feeds and comments into a beautifulsoup string arbiel 1 1,193 Jul-20-2022, 09:05 AM
Last Post: arbiel
  Can you print a string variable to printer hammer 2 1,963 Apr-30-2022, 11:48 PM
Last Post: hammer
  Print to a New Line when Appending File DaveG 0 1,229 Mar-30-2022, 04:14 AM
Last Post: DaveG

Forum Jump:

User Panel Messages

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