# Doubt Python Mastery Exercise (No. 21)

**URL:** <https://forum.codewithmosh.com/t/doubt-python-mastery-exercise-no-21/9155>\
**Category:** Python\
**Created:** [December 13, 2021, 8:48am UTC](https://forum.codewithmosh.com/t/doubt-python-mastery-exercise-no-21/9155 "2021-12-13T08:48:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolbeast](https://avatars.discourse-cdn.com/v4/letter/l/e480ec/32.png) [@lolbeast](https://forum.codewithmosh.com/u/lolbeast)\
**Post date:** [December 13, 2021, 8:48am UTC](https://forum.codewithmosh.com/t/doubt-python-mastery-exercise-no-21/9155/1 "2021-12-13T08:48:03Z")

</div>

Hi, was doing the python mastery course when i came across this exercise - cane up with this solution within 5-7 mins. Still dont understand why i cant input strings with spaces. kindly help - thanks

* * *

```auto
user_input = input(">>> ")

temp_set = set(user_input.lower())

# nums = {}

count = 0
gsum = sum2 = 0
alpha = ""

for letter in temp_set:
    for letter1 in user_input.lower():
        if letter1 == letter:
            count += 1
    if not gsum:
        gsum = count
        alpha = letter
    if gsum:
        sum2 = count
        if sum2 > gsum:
            gsum = sum2
            alpha = letter
    count = 0

print(alpha)

# HEllO

# output the L

```
