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)
#1
Hello. So, I have just started learning Python and now I would like some help.

The code works but there is a space after the last random generated number, how to remove that space?

print('What is',random.randrange(1, 11),'times',random.randrange(1, 11),'?')
Example: What is 3 times 2 ?

Is lstrip() something useable here?
Reply


Messages In This Thread
Remove space after random.randrange(1, 11) - by rs74 - Jun-06-2020, 06:37 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,709 Oct-23-2022, 11:13 PM
Last Post: Pedroski55
  Remove a space between a string and variable in print sie 5 1,958 Jul-27-2022, 02:36 PM
Last Post: deanhystad
  from global space to local space Skaperen 4 2,420 Sep-08-2020, 04:59 PM
Last Post: Skaperen
  How to remove space between strings sunnyarora 2 2,801 May-03-2019, 11:44 AM
Last Post: perfringo
  random.randrange ravioli2929 14 7,148 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