How can we help you today? How can we help you today?

How to select a random number from a List

I tried using random.choice() but didnt work I got the below error
Error: AttributeError : 'Random' object has no attribute 'choice'
shravan
0

Comments

2 comments

  • shravan
    Here is my code:

    __randomize__ = False
    import System
    from System import Random
    random = Random()
    month=[12,34,56,78]
    def main(config):
          return random.choice(month)
          



    shravan
    0
  • Tianjiao_Li
    Hi @shravan

    Can you share a screenshot of the error where I can see other setting as well?
    Tianjiao_Li
    0

Add comment

Please sign in to leave a comment.