+ 1
Random letter
In python, how would i pick a random letter from the alphabet using the function guess_letter()? -I tried using a list but I must have did it wrong because it does not work
5 Antworten
+ 2
import random
def guess_letter();
a = random.choice(ascii_letters)
print a
—I don’t think this is correct but this is how i approached it
+ 1
you must observe that:
- ascii_letters is defined in string module
- You must print a but a is in function scope and you search it in a "more" extern scope (eg. a is not visible in print call)
+ 1
ok thank you very much
+ 1
👍👍👍👍
0
Post your code please and when we work on that