0

Hello how we can know the string is isogram detector

20th Aug 2023, 10:32 AM
Ahlam Abdurehman
Ahlam Abdurehman - avatar
6 Réponses
+ 1
Евгений It checks if a word does not contain a duplicated character.. For example, "heloo" has repeated letter "o" which makes it not an isogram Anyways, Ahlam Abdurehman please show us your attempt here
20th Aug 2023, 1:13 PM
Dragon RB
Dragon RB - avatar
+ 6
Dragon RB , an isogram is a string in which *each* letter occurs only once. it is not just about vowels.
20th Aug 2023, 2:07 PM
Lothar
Lothar - avatar
+ 4
Ahlam Abdurehman , to get this task done, we can go for one of these approaches: (1) using a set: we can take the string that should be checked and find its number of characters with len() function. we take the same string and convert it to a set. this will remove all duplicated letters. then check the set for its number of characters. if both strings have the same length, it is an isogram. (2) using a loop we run a loop over the string to check. for each character we get in the loop, we can check if it occurs multiple times by using the string method count(). if count returns a number greater than 1, it is no isogram.
20th Aug 2023, 2:29 PM
Lothar
Lothar - avatar
+ 2
Thank you
20th Aug 2023, 2:32 PM
Ahlam Abdurehman
Ahlam Abdurehman - avatar
+ 1
What is isogram?
20th Aug 2023, 12:06 PM
Евгений
Евгений - avatar
+ 1
Lothar Ah yes, my bad.
20th Aug 2023, 2:08 PM
Dragon RB
Dragon RB - avatar