Question
Write a Python function which will be called: KeyGen. The important function that must be performed is verifying that the chosen keyword contains no double
Write a Python function which will be called: KeyGen. The important function that must be performed is verifying that the chosen keyword contains no double letters. So HELLO and 111 are invalid keywords, but PIKACHU and ORANGE are valid. It may have the following psuedocode:
INPUT: None
OUTPUT: keyword
*****************************
def KeyGen ():
while True:
Ask user for keyword
Check if keyword has any repeated letters
If the keyword has no repeated letters:
return the keyword
Hint: You might want to use Python's count method. For instance, if a = 'foo' then a.count ('f') returns 1, while a.count ('o') returns 2. A keyword where the count of each letter in the keyword is 1.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started