mercredi 23 août 2017

How to print the characters horizontally?

def rand_gen1():
    import random
    for i in range(8):
        print random.choice('0123456789abcdefghijklmnopqrstuvwxyz')

The above piece of code prints a string of 8 random chars or ints or both vertically. I need it to print like 'abcd123b' i.e. horizontally.

What changes do I need to make ?




Aucun commentaire:

Enregistrer un commentaire