Python code challenge | SoloLearn: Learn to code for FREE!


Python code challenge

Can someone help me with a python code that generates more than 20 random characters

11/20/2020 8:36:47 AM

IzaiaH KaY

7 Answers

New Answer


Where's your attempt?


To generate multiple random characters , using choices() is always a good idea. The code gets shorter and still has a good readability. You can further do an optimization in limiting the import of not necessary functions / methods. Instead of importing module string completely, or module random completely, you can do it like this: from string import ascii_lowercase as asc_lo from random import choices print(''.join(choices(asc_lo, k=42)))


NotAPythonNinja thank you But your code prints separate characters.. I wanted one that prints a string of text


CarrieForle I'm Still figuring it out 😃 Trying to debug it


I've tried but it seems to have bugs Someone should help me out


NotAPythonNinja thank you alot


Lothar thanks alot