THINKING & TESTING: HOW MANY "WORD"?
EXPLANATION CODE:
1) This is a Python function that takes a string s as an argument and returns the number of times the letters in the string alternate between uppercase and lowercase.
2)Here's how the function works:
It initializes a string key with the value 'word'.
It initializes a variable letter_i with the value 0.
It loops through each character c in the string s.
If the lowercase version of the current character matches the character in key at index letter_i % len(key), the function increments letter_i.
The function returns the integer division of letter_i by the length of key.
Contents:
0:00 - Reading
1:10 - Solving
2:25 - Explaining
#codewars #code #wars #javascript #game #how #many #word #thinking #testing #pythonprogramming #programming #python #education #tutorial #computerscience #games #puzzles
Other Videos By One Person Studio
2023-05-07 | TEA #shorts #animation |
2023-05-07 | IRON MAN #shorts #art #drawing |
2023-05-07 | BARLEY ICON FROM BRAWL STARS #shorts #art #drawing |
2023-05-07 | SKETCHBOOK TOUR PART CXVII #shorts #art #drawing |
2023-05-06 | KAKASHI HATAKE #shorts #art #drawing |
2023-05-06 | DORY #shorts #art #drawing |
2023-05-06 | OMELETTE #shorts #animation |
2023-05-06 | ECHO |
2023-05-06 | BOROS #shorts #art #drawing |
2023-05-06 | MEGA BLAZIKEN #shorts #art #drawing |
2023-05-06 | THINKING & TESTING: HOW MANY "WORD"? |
2023-05-06 | SKETCHBOOK TOUR PART CXVI #shorts #art #drawing |
2023-05-05 | SONIC #shorts #art #drawing |
2023-05-05 | GIRL XXV #shorts #art #drawing |
2023-05-05 | SCOOBY-DOO #shorts #art #drawing |
2023-05-05 | RICK #shorts #art #drawing |
2023-05-05 | CREDIT CARD VERIFIER (LUHNβS ALGORITHM) |
2023-05-05 | BUCKET #shorts #blender #animation |
2023-05-04 | ROD WAVE #shorts #art #drawing |
2023-05-04 | APPLE AND ORANGE |
2023-05-04 | MEWTWO #shorts #art #drawing |