samedi 30 octobre 2021

Create a function which accepts a size integer number and generates a random 'word' with that size. For example [closed]

Create a function that accepts a size integer number and generates a random 'word' with that size. For example:

Input size of the random word: 5

Your random word with 5 characters is: wAnBc

I did some part but its wrong and i need some help.

import string as i
import random as r

n = int(input("Entrer size of the random word: "))

  
rnd = [chr(r.randint(ord('a'), ord('z') and ord('A'), ord('Z'))) for d in range(n)]
print(rnd)




Aucun commentaire:

Enregistrer un commentaire