Answer to Question #277808 in Python for Yash Parate

Question #277808

Construct an algorithm and write a python to create a regular expression to retrieve marks and names from a given string or files. Extract only marks having 2 digits and names starting with capital letter. A word is called as a good word if all the letters of the word are distinct. That is, all the letters of the word are different from each other letter. Else, the word is called as a bad word. Write an algorithm and the subsequent Python code to check if the given word is good or bad.: e.g. START, GOOD, BETTER are bad: WRONG is good! Make the comparison to be case insensitive.




1
Expert's answer
2021-12-09T17:36:58-0500
word = input('')
word = word.lower()
length = len(word)
count=0
for i in range(0,length):
    for j in range(0,length):
        if word[i]==word[j]:
            count+=1
if count==len(word):
    print('Good')
else:
    print('Bad')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS