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

+4

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

+6

Where's your attempt?

+4

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)))

+3

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

+2

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

+2

I've tried but it seems to have bugs Someone should help me out https://code.sololearn.com/c64DCh53HoC2/?ref=app

+2

NotAPythonNinja thank you alot https://code.sololearn.com/c8PXKOOXI05B/?ref=app

+2

Lothar thanks alot