Python - Jaden Casing Strings | Codewars 7KYU

  Рет қаралды 840

Wrt Tech

Wrt Tech

Күн бұрын

Capitalize the first letter of every word aka jaden casing strings

Пікірлер: 8
@marzhandzh289
@marzhandzh289 Жыл бұрын
thank you
@АндрейНИКАНОВ-у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'])
@supercrusher1235
@supercrusher1235 2 жыл бұрын
Thanks for the explanation, It helped a lot!
@Sugurous
@Sugurous 2 жыл бұрын
Thank you for the video.
Python - Cat Years, Dog Years | Codewars 8KYU
4:25
Wrt Tech
Рет қаралды 754
Python - Directions Reduction | Codewars 5KYU
5:58
Wrt Tech
Рет қаралды 1,1 М.
Every parent is like this ❤️💚💚💜💙
00:10
Like Asiya
Рет қаралды 16 МЛН
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 3,9 МЛН
The day of the sea 😂 #shorts by Leisi Crazy
00:22
Leisi Crazy
Рет қаралды 2,2 МЛН
Codewars (Python🐍) | Consecutive strings | kyu6
4:56
Hidde Tieleman
Рет қаралды 222
python 3.13 release highlights
49:56
anthonywritescode
Рет қаралды 17 М.
Python - Your Order Please | Codewars 6KYU
5:08
Wrt Tech
Рет қаралды 880
ASMR Programming - Spinning Cube - No Talking
20:45
Servet Gulnaroglu
Рет қаралды 4 МЛН
ASMR Programming - Flappy Bird - No Talking
1:15:51
Mehmet Emin Eker
Рет қаралды 872 М.
Can You Make YouTube From Scratch Using Only Bash?
17:51
Python - Pete, the Baker | Codewars 5KYU
6:34
Wrt Tech
Рет қаралды 723
JavaScript Basics and Codewars. Jaden Smith Case Algorithm
10:54
Algorithm Anthony
Рет қаралды 141
How To Think Like A Programmer
1:00:07
Coding Tech
Рет қаралды 2 МЛН