Python Forum
Remove space after random.randrange(1, 11)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove space after random.randrange(1, 11)
#3
(Jun-06-2020, 06:44 AM)DPaul Wrote: Your have a print statement with commas that generate blank spaces, formatting gives more control.
Perhaps you are looking for this:
print('What is {} times {}?'.format(random.randrange(1, 11),random.randrange(1, 11)))
Paul

Oh, thanks for fast reply, it works great. Interesting with .format, will read and test more.
Reply


Messages In This Thread
RE: Remove space after random.randrange(1, 11) - by rs74 - Jun-06-2020, 07:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] why can't i create a list of numbers (ints) with random.randrange() astral_travel 7 1,643 Oct-23-2022, 11:13 PM
Last Post: Pedroski55
  Remove a space between a string and variable in print sie 5 1,884 Jul-27-2022, 02:36 PM
Last Post: deanhystad
  from global space to local space Skaperen 4 2,397 Sep-08-2020, 04:59 PM
Last Post: Skaperen
  How to remove space between strings sunnyarora 2 2,775 May-03-2019, 11:44 AM
Last Post: perfringo
  random.randrange ravioli2929 14 7,034 Mar-17-2019, 04:49 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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