Issue
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
Solution
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)
Answered By - Ayyoub ESSADEQ
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.