title: Define function which gives random values in a given range in Python
body: <p>I am working on a blackjack game in python with no <code>graphics</code> or <code>pygame</code>, but I need it so if they use the <code>hit</code> option it should give them a card with totally other value. I have looked at <a href="https://stackoverflow.com/questions/4611589/in-python-is-there-anyway-to-have-a-variable-be-a-different-random-number-every">In python, is there anyway to have a variable be a different random number everytime?</a>, and also many other websites. I have got no information about how to do this.
  Code :D</p>
  
  <pre class="lang-py prettyprint-override"><code>suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs')
  ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace')
  values = {'Two':2, 'Three':3, 'Four':4, 'Five':5, 'Six':6, 'Seven':7, 'Eight':8, 'Nine':9, 'Ten':10, 'Jack':10,'Queen':10, 'King':10, 'Ace':11}
  
  ###Printing Random
  s = lambda: secure_choice.choice(suits)
  r = lambda: secure_choice.choice(ranks)
  ds = secure_choice.choice(suits)
  dr = secure_choice.choice(ranks)
  v = values.get(r)
  dv = values.get(dr)
  
  
  def pullCard():
      print(f"You pulled a {r} of {s} the value is {v}")
      print(f"The dealer pulled a {dr} of {ds} the value is {dv}")
  
  
  
  def dealerOnly():
      print('You standed')
  
  
  
  pullCard()
  
  Answer = str(input('Do you want to Hit or Stand?')).lower()
  if Answer == 'stand':
      dealerOnly()
  elif Answer == 'hit':
      pullCard()
  
  </code></pre>
  
  <p>What I think could work:</p>
  
  <pre><code>
  def ReValueCard():
      s = secure_choice.choice(suits)
      r = secure_choice.choice(ranks)
  
  </code></pre>