Python Forum
Using random.choice v.v
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using random.choice v.v
#8
(Aug-31-2019, 04:30 AM)Dawkinz Wrote:
print([random.choice(old_people), random.choice(young_people), random.choice(mid_age)])

The only issue now is that it prints ['Owen', 'Gwen', 'Greg']
I just want it to print without commas, brackets, or quotation marks.
What would I need to add to my code to accomplish this?
I would just not put all random choices into a list (donĀ“t use the [] brackets)
print(random.choice(old_people), random.choice(young_people), random.choice(mid_age))
Reply


Messages In This Thread
Using random.choice v.v - by Dawkinz - Aug-31-2019, 02:34 AM
RE: Using random.choice v.v - by Dawkinz - Aug-31-2019, 03:52 AM
RE: Using random.choice v.v - by perfringo - Aug-31-2019, 03:58 AM
RE: Using random.choice v.v - by Dawkinz - Aug-31-2019, 04:30 AM
RE: Using random.choice v.v - by perfringo - Aug-31-2019, 04:33 AM
RE: Using random.choice v.v - by ThomasL - Aug-31-2019, 10:55 AM
RE: Using random.choice v.v - by Dawkinz - Aug-31-2019, 04:42 PM
RE: Using random.choice v.v - by scidam - Aug-31-2019, 03:59 AM
RE: Using random.choice v.v - by Dawkinz - Aug-31-2019, 04:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Assistance with pythons random.choice coleslaw 5 2,679 Nov-19-2019, 12:01 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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