Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

error in generating random comments

Im working in a commenting bot ..
How to make it choose a different comment in each time ?
I'm noob
Code
import random
comments = ["hello", "goodbye"]

print(random.choice(comments))
Code
import random
def randComment():
    comments = ["comment1", "comment2", "comment3", "comment4", "comment5"]
    randomComment = comments[random.randint(0,4)]
    return print(randomComment)
randComment()


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by absojediDec 27, 2020 02:43 PM 3 139 Dec 27, 2020 02:43 PM
Last Post: absojedi
[Java] by .eXeSep 16, 2020 03:39 AM 3 223 Sep 16, 2020 03:39 AM
Last Post: InterestingUser1111
[C#] by PawnhubNov 16, 2019 05:19 PM 20 896 Nov 16, 2019 05:19 PM
Last Post: SIM-4440595