0

I'm creating a random password generator using Visual Studio IDE and Python 3.6, I have wrote some code and after pressing F5 I see just blank black command prompt of Python, my code is down below, do anyone can help me with this? Screen shot of the problem.

import string
import random

def randompassword():
  chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
  size = random.randint(8, 16)
  return ''.join(random.choice(chars) for x in range(size,16))

1 Answers1

1

Probably the issue is that you are not actually executing the function, so Python has nothing to do. Try calling the function, like so

import string
import random

def randompassword():
  chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
  size = random.randint(8, 12)
  return ''.join(random.choice(chars) for x in range(size,16))

print(randompassword())
Bram Vanroy
  • 27,032
  • 24
  • 137
  • 239