일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- map
- STR
- range
- list
- or
- FOR
- SQL
- 파이썬
- and
- DART
- iNT
- 위코드
- WECODE
- join
- enumerate
- js
- If
- len
- lambda
- MAX
- sum
- Algorithm
- slice
- index
- count
- split
- LOWER
- Python
- Sorted
- decorator
- Today
- Total
목록split (21)
코드로 우주평화
Description: For every string, after every occurrence of 'and' and/or 'but', insert the substring 'apparently' directly after the occurrence(s). If input does not contain 'and' or 'but', return the same string. If a blank string, return ''. If substring 'apparently' is already directly after an 'and' and/or 'but', do not add another. (Do not add duplicates). Examples: Input 1 'It was great and I..
Description: Simple, given a string of words, return the length of the shortest word(s). String will never be empty and you do not need to account for different data types. Solution: 1. Count the number of letters in each word. 2. Returns the smallest number of characters. def find_short(s): return min(list(map(len, s.split())))
Introduction The first century spans from the year 1 up to and including the year 100, the second century - from the year 101 up to and including the year 200, etc. Task Given a year, return the century it is in. Examples 1705 --> 18 1900 --> 19 1601 --> 17 2000 --> 20 Solution: 1. Divide 'year' by 100. 2. Returns the decimal point rounded up. import math def century(year): return math.ceil(year..
Description: This is a spin off of my first kata. You are given a string containing a sequence of character sequences separated by commas. Write a function which returns a new string containing the same character sequences except the first and the last ones but this time separated by spaces. If the input string is empty or the removal of the first and last items would cause the resulting string ..
Description: Complete the function that accepts a string parameter, and reverses each word in the string. All spaces in the string should be retained. Examples "This is an example!" ==> "sihT si na !elpmaxe" "double spaces" ==> "elbuod secaps" Solution: 1. Separate text based on space. 2. Turn over the separated text and put it in an array. 3. Convert the text in the array to a string with space..
Description: John has invited some friends. His list is: s = "Fred:Corwill;Wilfred:Corwill;Barney:Tornbull;Betty:Tornbull;Bjon:Tornbull;Raphael:Corwill;Alfred:Corwill"; Could you make a program that makes this string uppercase gives it sorted in alphabetical order by last name. When the last names are the same, sort them by first name. Last name and first name of a guest come in the result betwe..
Description: In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number. Examples highAndLow("1 2 3 4 5"); // return "5 1" highAndLow("1 2 -3 4 5"); // return "5 -3" highAndLow("1 9 3 4 -5"); // return "9 -5" Notes All numbers are valid Int32, no need to validate them. There will always be at least one number in the input string...
Description: Write a function to convert a name into initials. This kata strictly takes two words with one space in between them. The output should be two capital letters with a dot separating them. It should look like this: Sam Harris => S.H patrick feeney => P.F solution: 1. Change the name to all uppercase letters. 2. Separate strings based on space and put them in an array. 3. Put the first ..
문제 설명 The marketing team is spending way too much time typing in hashtags. Let's help them with our own Hashtag Generator! Here's the deal: It must start with a hashtag (#). All words must have their first letter capitalized. If the final result is longer than 140 chars it must return false. If the input or the result is an empty string it must return false. Examples " Hello there thanks for try..
문제 설명 Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (Just like the name of this Kata). Strings passed in will consist of only letters and spaces. Spaces will be included only when more than one word is present. Examples: spinWords( "Hey fellow warriors" ) => returns "Hey wollef sroirraw" spinWords( "This..