Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Creating Programme that finds strength of password.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I need help creating this programme.
I need to define a function
passGen, which takes two arguments: strength and passLength. The value of
strength can either be strong or medium (default is strong) and the value of
passLength ranges from 8-12 (default is 8).

If password’s length is less than 8 or greater than 12, the program prints out the
following message: "sorry, password must consist of at least 8-12 characters".

If password’s strength is set to ‘medium’, an 8-12 long random password is generated
out of the following characters: "abcdefghijklmnopqrstuvwxyz

If password’s strength is set to ‘strong’, an 8-12 long random password is generated
out of the following characters:
"abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXY
Z!@#$%^&*()?"

For example:
If the input is: passGen(‘strong’, 10)
A possible valid output would be: ^CYpJ?V8d*
 
Saloon Keeper
Posts: 11882
253
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

Is this an assignment? If not, the functional requirements are rather silly. The only thing that determines password strength is length, and there should be no maximum length.
 
Dig Vijay
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Welcome to CodeRanch!

Is this an assignment? If not, the functional requirements are rather silly. The only thing that determines password strength is length, and there should be no maximum length.



Yes please
 
Stephan van Hulst
Saloon Keeper
Posts: 11882
253
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dig Vijay wrote:Yes please


Do you have a specific problem that you're stuck on? How can we help you?
 
Dig Vijay
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:

Dig Vijay wrote:Yes please


Do you have a specific problem that you're stuck on? How can we help you?


need help with whole quesstion
 
Stephan van Hulst
Saloon Keeper
Posts: 11882
253
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seeing as you posted this in the Python forum, I'm going to assume that you must write the program in Python.

Have you learned some Python yet? Show us what code you've tried out, or tell us what about the question you don't understand. We can't help you if you don't give us anything to start with.
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic