일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- sum
- If
- lambda
- FOR
- Sorted
- index
- LOWER
- WECODE
- 위코드
- len
- Algorithm
- SQL
- split
- enumerate
- join
- or
- list
- count
- js
- Python
- range
- and
- 파이썬
- decorator
- iNT
- slice
- STR
- MAX
- DART
- Today
- Total
목록lambda (17)
코드로 우주평화
Happy Holidays fellow Code Warriors! Santa's senior gift organizer Elf developed a way to represent up to 26 gifts by assigning a unique alphabetical character to each gift. After each gift was assigned a character, the gift organizer Elf then joined the characters to form the gift ordering code. Santa asked his organizer to order the characters in alphabetical order, but the Elf fell asleep fro..
You will be given an array a and a value x. All you need to do is check whether the provided array contains the value. Array can contain numbers or strings. X can be either. Return true if the array contains the value, false if not. Solution: check: bool = lambda x, y : y in x
Make a function that returns the value multiplied by 50 and increased by 6. If the value entered is a string it should return "Error". Solution: problem = lambda x: "Error" if isinstance(x, str) else x * 50 + 6
Task You've just moved into a perfectly straight street with exactly n identical houses on either side of the road. Naturally, you would like to find out the house number of the people on the other side of the street. The street looks something like this: Street 1| |6 3| |4 5| |2 you Evens increase on the right; odds decrease on the left. House numbers start at 1 and increase without gaps. When ..
Write a function get_char() / getChar() which takes a number and returns the corresponding ASCII char for that value. Example: get_char(65) should return: 'A' Solution: get_char = lambda x: chr(x)
Time to test your basic knowledge in functions! Return the odds from a list: [1, 2, 3, 4, 5] --> [1, 3, 5] [2, 4, 6] --> [] Solution: odds = lambda x: [i for i in x if i & 1]
In Python, there is a built-in filter function that operates similarly to JS's filter. For more information on how to use this function, visit https://docs.python.org/3/library/functions.html#filter The solution would work like the following: get_even_numbers([2,4,5,6]) => [2,4,6] Solution: def get_even_numbers(arr, condition = lambda x: x % 2 == 0): return [i for i in arr if condition(i)] def g..
Messi's Goal Total Use variables to find the sum of the goals Messi scored in 3 competitions Information Messi goal scoring statistics: Competition Goals La Liga 43 Champions League 10 Copa del Rey 5 Task Create these three variables and store the appropriate values using the table above: la_liga_goals champions_league_goals copa_del_rey_goals Create a fourth variable named total_goals that stor..
Given an array of integers as strings and numbers, return the sum of the array values as if all were numbers. Return your answer as a number. sum_mix = lambda x: sum(map(int, x))
This Kata is intended as a small challenge for my students All Star Code Challenge #18 Create a function that accepts 2 string arguments and returns an integer of the count of occurrences the 2nd argument is found in the first one. If no occurrences can be found, a count of 0 should be returned. ("Hello", "o") ==> 1 ("Hello", "l") ==> 2 ("", "z") ==> 0 Notes: The first argument can be an empty s..