Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

10. What is meant by a feed rate?

Answered: 1 week ago

Question

=+ What are the information and consultation requirements?

Answered: 1 week ago

Question

=+ Should the MNE belong (why, why not)?

Answered: 1 week ago