Python - Jaden Casing Strings | Codewars 7KYU

  Рет қаралды 861

Wrt Tech

Wrt Tech

Күн бұрын

Пікірлер: 8
@marzhandzh289
@marzhandzh289 Жыл бұрын
thank you
@supercrusher1235
@supercrusher1235 2 жыл бұрын
Thanks for the explanation, It helped a lot!
@Sugurous
@Sugurous 2 жыл бұрын
Thank you for the video.
@АндрейНИКАНОВ-у1м
@АндрейНИКАНОВ-у1м Жыл бұрын
Hi! Why it not work?! =( str = 'abc def ghi' return str.title()
@wrttech422
@wrttech422 Жыл бұрын
str is a keyword, and you cant use it as the name of a variable. Instead, write it like below (or something similar) strr = 'abc def ghi' return strr.title() im assuming there is more to this code as well? Since you are using a return statement, it must exist within a function.
@АндрейНИКАНОВ-у1м
@АндрейНИКАНОВ-у1м Жыл бұрын
@@wrttech422 Task: Create a function called shortcut to remove the lowercase vowels (a, e, i, o, u ) in a given string (8kyu). I have 12 passed and 3 fails. "hello" --> "hll" "codewars" --> "cdwrs" "goodbye" --> "gdby" "HELLO" --> "HELLO" def shortcut( s ): s2 = 'a,e,i,o,u' s3 = "" for x in s: if x not in s2 or x.isupper(): s3 += x return s3
@wrttech422
@wrttech422 Жыл бұрын
The code below works. The problem you had was with the string s2 = "a,e,i,o,u". Reason being is bc you're using that string to remove the lowercase vowels from string s; however, string s2 contains 4 commas which will also be removed from string s. Unlike lists, strings do not require commas as separators. Copy and paste the code below def shortcut( s ): s2 = 'aeiou' s3 = "" for x in s: if x not in s2: s3 += x return s3
@wrttech422
@wrttech422 Жыл бұрын
You could also do it in one line of code like below: def shortcut( s ): return ''.join([i for i in s if i not in 'aeiou'])
Python - Disemvowel Trolls | 7KYU
3:01
Wrt Tech
Рет қаралды 755
Python - Your Order Please | Codewars 6KYU
5:08
Wrt Tech
Рет қаралды 899
这是自救的好办法 #路飞#海贼王
00:43
路飞与唐舞桐
Рет қаралды 103 МЛН
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 23 МЛН
У вас там какие таланты ?😂
00:19
Карина Хафизова
Рет қаралды 19 МЛН
JavaScript Basics and Codewars. Jaden Smith Case Algorithm
10:54
Algorithm Anthony
Рет қаралды 142
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 829 М.
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 411 М.
Python - Directions Reduction | Codewars 5KYU
5:58
Wrt Tech
Рет қаралды 1,1 М.
I went to a Kamala Harris rally, here is what I saw
10:49
HugoDécrypte - Grands formats
Рет қаралды 567 М.
ASMR Programming - Spinning Cube - No Talking
20:45
Servet Gulnaroglu
Рет қаралды 4,1 МЛН
4 Reasons Why Samsung are in Trouble
9:16
TLDR Business
Рет қаралды 75 М.
How to read Russian
29:12
RussianLearnsYou
Рет қаралды 2,8 МЛН
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
这是自救的好办法 #路飞#海贼王
00:43
路飞与唐舞桐
Рет қаралды 103 МЛН