input: Write a function to generate a random password consisting of 8 characters from a set of ASCII letters and digits. The function should return the generated password as a string.
  assert generate_password().isalnum()==True
output: import random
  import string
  
  def generate_password():
      return ''.join(random.choices(string.ascii_letters + string.digits, k=8))