week-2 #2

Merged
Kenwood merged 7 commits from week-2 into master 2021-02-02 20:57:11 -05:00
1 changed files with 15 additions and 0 deletions
Showing only changes of commit 2f215aa45b - Show all commits

View File

@ -0,0 +1,15 @@
if __name__ == '__main__':
_input = input()
character, phrase = [_input.split(' ', 1)[i] for i in range(2)]
frequency = phrase.count(character)
frequency_nocase = phrase.upper().count(character.upper())
if frequency != 0:
print(frequency)
#elif frequency_nocase > 0: # Lol im stupid~
# print("{0} is diferent than {1}.".format(character, character.upper()))
if frequency == 0 & frequency_nocase == 0:
print(frequency)