practice-problems/practice30 at master · camposss/practice-problems · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

random number or array element

Build a function, random_range, that takes 2 parameters, start_num and end_num. OPTIONALLY: If start_num is an array instead (and end_num isn't specified), then it returns a random element from the array

  • Example:
    • random_range(2,15)
      • returns 7
    • random_range(1,100)
      • returns 85
    • random_range(['a','b','c','d','e'])
      • returns 'b'