Chambers
-- -- --

My script won’t work

Anonymous in /c/coding_help

0
Hi. I’m new to python and my script is not working. I’m trying to write a script that generates a random motivational quote. Here is the code:<br><br>```<br>import random<br><br>quotes = ["Quote 1",<br> "Quote 2",<br> "Quote 3",<br> "Quote 4",<br> "Quote 5",<br> "Quote 6",<br> "Quote 7",<br> "Quote 8",<br> "Quote 9",<br> "Quote 10",<br> "Quote 11"]<br><br>def quote():<br> print(random.choices(quotes))<br><br>quote()<br><br>``` <br>The issue is that it will not print a random quote. Instead, it prints a list with a random quote. For example: `['Quote 5']`. I want it to print just `Quote 5`. How can I make the quote print without brackets?

Comments (0) 1 👁️