0

How do I get the outputs to be in one row, instead of multiple?

This is my code:

import random
Lu=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
Ll=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
N=['1','2','3','4','5','6','7','8','9']
S=['!','@','#','$','%','&','*']
def rp(num):
    for r in range(num):
        P1=random.choice(Lu)
        print(P1)
rp(10)

And this is the output:

U

J

K

W

Q

Q

T

O

V

R

  • Does this answer your question? [multiple prints on the same line in Python](https://stackoverflow.com/questions/5598181/multiple-prints-on-the-same-line-in-python) – TheFungusAmongUs May 24 '22 at 15:02

1 Answers1

-1
import random
Lu=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
Ll=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
N=['1','2','3','4','5','6','7','8','9']
S=['!','@','#','$','%','&','*']
def rp(num):
    for r in range(num):
        P1=random.choice(Lu)
        print(P1 ,end = ' ')
rp(10)
Ayyoub ESSADEQ
  • 776
  • 2
  • 14