Python Forum
List conversion and multiplication
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List conversion and multiplication
#4
You don't need to create the list, since strings are also sequences. That means you can iterate over them directly:

>>> for c in "foo":
...     print(c)
... 
f
o
o
>>> 
Reply


Messages In This Thread
List conversion and multiplication - by johnkyp - Dec-25-2019, 12:41 AM
RE: List conversion and multiplication - by johnkyp - Dec-25-2019, 11:36 AM
RE: List conversion and multiplication - by ndc85430 - Dec-27-2019, 02:26 PM
RE: List conversion and multiplication - by johnkyp - Jan-01-2020, 08:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiplication Table code alexsendlegames100 3 1,421 Jun-06-2022, 09:45 AM
Last Post: Gribouillis
  Try to solve GTG multiplication table problem. Frankduc 6 2,075 Jan-18-2022, 08:26 PM
Last Post: Frankduc
  Need help with my Python code (Multiplication) NeedHelpPython 2 1,726 Oct-04-2021, 12:09 PM
Last Post: Pedroski55
  Matrix Multiplication Issue VIJENDRA 1 1,900 Dec-19-2019, 06:16 PM
Last Post: Gribouillis
  Multiplication between a list and a variable doug2019 2 2,198 Oct-08-2019, 04:10 AM
Last Post: doug2019
  Multiplication Table number margins CJ707 4 2,479 Sep-18-2019, 02:16 PM
Last Post: CJ707
  multiplication by successive addition Zebrol 1 3,561 Sep-14-2019, 05:37 PM
Last Post: ichabod801
  Filter to List and/or Tuple conversion vindo 3 2,804 May-18-2019, 05:40 AM
Last Post: perfringo
  float multiplication - unexpected output inesk 3 3,389 Dec-11-2018, 10:59 AM
Last Post: DeaD_EyE
  Print every multiplication of recursion Arontbt 4 3,813 Apr-24-2018, 10:01 PM
Last Post: Arontbt

Forum Jump:

User Panel Messages

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