Python Forum
Trying to understand strings and lists of strings
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to understand strings and lists of strings
#1
Lets say we have a string a = "apple" and we wish to add this variable in a list fruits = [], using fruits.append(a). But when we print the list, the string "apple" is stored like this in the list, ['apple']. So my question now is, why does python not store strings in double qoutes " " instead of single qoutes ' ' inside a list? or is there a workaround to store strings with double qoutes inside a list? like what's the process behind storing strings in an array or list
Reply


Messages In This Thread
Trying to understand strings and lists of strings - by Konstantin23 - Aug-06-2023, 10:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can you explain the strings in Python ebn852_pan 3 131 Yesterday, 08:36 AM
Last Post: Pedroski55
Information Do regular expressions still need raw strings? bobmon 3 375 May-03-2024, 09:05 AM
Last Post: rishika24
  [SOLVED] Pad strings to always get three-digit number? Winfried 2 436 Jan-27-2024, 05:23 PM
Last Post: Winfried
  Tab Delimited Strings? johnywhy 7 709 Jan-13-2024, 10:34 PM
Last Post: sgrey
Question [PyMuPDF] Grab all strings of a given size? Winfried 3 734 Dec-26-2023, 07:39 AM
Last Post: Pedroski55
  How to read module/class from list of strings? popular_dog 1 538 Oct-04-2023, 03:08 PM
Last Post: deanhystad
  Hard time trying to figure out the difference between two strings carecavoador 2 723 Aug-16-2023, 04:53 PM
Last Post: carecavoador
  problem in using int() with a list of strings akbarza 4 813 Jul-19-2023, 06:46 PM
Last Post: deanhystad
  Taking Mathematical Expressions from Strings quest 2 756 Jul-02-2023, 01:38 PM
Last Post: Pedroski55
  xml indent SubElements (wrapping) with multiple strings ctrldan 2 1,593 Jun-09-2023, 08:42 PM
Last Post: ctrldan

Forum Jump:

User Panel Messages

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