일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- count
- lambda
- Sorted
- FOR
- DART
- SQL
- iNT
- sum
- LOWER
- map
- Python
- len
- STR
- slice
- WECODE
- range
- If
- js
- 파이썬
- MAX
- index
- and
- split
- Algorithm
- join
- decorator
- 위코드
- enumerate
- list
- or
- Today
- Total
목록FOR (78)
코드로 우주평화
An anagram is the result of rearranging the letters of a word to produce a new word (see wikipedia). Note: anagrams are case insensitive Complete the function to return true if the two arguments given are anagrams of each other; return false otherwise. Examples "foefet" is an anagram of "toffee" "Buckethead" is an anagram of "DeathCubeK" Solution: def is_anagram(test, original): if len(test) < l..
Your task is to write function findSum. Upto and including n, this function will return the sum of all multiples of 3 and 5. For example: findSum(5) should return 8 (3 + 5) findSum(10) should return 33 (3 + 5 + 6 + 9 + 10) Solution: def find(n): return sum([i for i in range(1, n+1) if i%3 == 0 or i%5 == 0]) 1. Find a number less than 'n'. 2. Find a number that is divisible by 3 or divisible by 5..
Instructions Write a function that takes a single string (word) as argument. The function must return an ordered list containing the indexes of all capital letters in the string. Example Test.assertSimilar( capitals('CodEWaRs'), [0,3,4,6] ); Solution: 1. Find the uppercase character in the string. 2. It returns the index of the corresponding character in an array. def capitals(word): return [i f..
You will be given an array of objects (associative arrays in PHP, table in COBOL) representing data about developers who have signed up to attend the next coding meetup that you are organising. Your task is to return an object (associative array in PHP, table in COBOL) which includes the count of each coding language represented at the meetup. For example, given the following input array: list1 ..
Some people just have a first name; some people have first and last names and some people have first, middle and last names. You task is to initialize the middle names (if there is any). Examples 'Jack Ryan' => 'Jack Ryan' 'Lois Mary Lane' => 'Lois M. Lane' 'Dimitri' => 'Dimitri' 'Alice Betty Catherine Davis' => 'Alice B. C. Davis' Solution: 1. If there are 3 or more elements of name, only the f..
Given an array of numbers, return a new array of length number containing the last even numbers from the original array (in the same order). The original array will be not empty and will contain at least "number" even numbers. For example: ([1, 2, 3, 4, 5, 6, 7, 8, 9], 3) => [4, 6, 8] ([-22, 5, 3, 11, 26, -6, -7, -8, -9, -8, 26], 2) => [-8, 26] ([6, -25, 3, 7, 5, 5, 7, -3, 23], 1) => [6] Solutio..
There is a bus moving in the city, and it takes and drop some people in each bus stop. You are provided with a list (or array) of integer pairs. Elements of each pair represent number of people get into bus (The first item) and number of people get off the bus (The second item) in a bus stop. Your task is to return number of people who are still in the bus after the last bus station (after the l..
Trolls are attacking your comment section! A common way to deal with this situation is to remove all of the vowels from the trolls' comments, neutralizing the threat. Your task is to write a function that takes a string and return a new string with all vowels removed. For example, the string "This website is for losers LOL!" would become "Ths wbst s fr lsrs LL!". Note: for this kata y isn't cons..
The Western Suburbs Croquet Club has two categories of membership, Senior and Open. They would like your help with an application form that will tell prospective members which category they will be placed. To be a senior, a member must be at least 55 years old and have a handicap greater than 7. In this croquet club, handicaps range from -2 to +26; the better the player the lower the handicap. I..
We want to know the index of the vowels in a given word, for example, there are two vowels in the word super (the second and fourth letters). So given a string "super", we should return a list of [2, 4]. Some examples: Mmmm => [] Super => [2,4] Apple => [1,5] YoMama -> [1,2,4,6] NOTES Vowels in this context refers to: a e i o u y (including upper case) This is indexed from [1..n] (not zero index..