일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- SQL
- 위코드
- FOR
- WECODE
- 파이썬
- DART
- index
- list
- or
- MAX
- range
- enumerate
- STR
- Sorted
- slice
- LOWER
- lambda
- split
- iNT
- js
- join
- len
- Python
- sum
- Algorithm
- count
- decorator
- If
- and
- map
- Today
- Total
목록If (41)
코드로 우주평화
Inspired by the development team at Vooza, write the function that accepts the name of a programmer, and returns the number of lightsabers owned by that person. The only person who owns lightsabers is Zach, by the way. He owns 18, which is an awesome number of lightsabers. Anyone else owns 0. Note: your function should have a default parameter. For example(Input --> Output): "anyone else" --> 0 ..
There are pillars near the road. The distance between the pillars is the same and the width of the pillars is the same. Your function accepts three arguments: number of pillars (≥ 1); distance between pillars (10 - 30 meters); width of the pillar (10 - 50 centimeters). Calculate the distance between the first and the last pillar in centimeters (without the width of the first and last pillar). So..
Create a function called _if which takes 3 arguments: a boolean value bool and 2 functions (which do not take any parameters): func1 and func2 When bool is truth-ish, func1 should be called, otherwise call the func2. Example: def truthy(): print("True") def falsey(): print("False") _if(True, truthy, falsey) # prints 'True' to the console Solution: def _if(bool, func1, func2): return func1() if b..
Is the string uppercase? Task Create a method to see whether the string is ALL CAPS. Examples (input -> output) "c" -> False "C" -> True "hello I AM DONALD" -> False "HELLO I AM DONALD" -> True "ACSKLDFJSgSKLDFJSKLDFJ" -> False "ACSKLDFJSGSKLDFJSKLDFJ" -> True In this Kata, a string is said to be in ALL CAPS whenever it does not contain any lowercase letter so any string containing no letters at..
Grade book Complete the function so that it finds the average of the three scores passed to it and returns the letter value associated with that grade. Numerical Score Letter Grade 90
In this simple assignment you are given a number and have to make it negative. But maybe the number is already negative? Examples makeNegative(1); // return -1 makeNegative(-5); // return -5 makeNegative(0); // return 0 makeNegative(0.12); // return -0.12 Notes The number can be negative already, in which case no change is required. Zero (0) is not checked for any specific sign. Negative zeros m..
Complete the method that takes a boolean value and return a "Yes" string for true, or a "No" string for false. Solution: String bool_to_word(bool boolean) { String result = "No"; if (boolean == true) { result = "Yes"; } return result; } // or String bool_to_word(bool boolean) => boolean ? "Yes" : "No";
You are required to create a simple calculator that returns the result of addition, subtraction, multiplication or division of two numbers. Your function will accept three arguments: The first and second argument should be numbers. The third argument should represent a sign indicating the operation to perform on these two numbers. if the variables are not numbers or the sign does not belong to t..
Complete the method which accepts an array of integers, and returns one of the following: "yes, ascending" - if the numbers in the array are sorted in an ascending order "yes, descending" - if the numbers in the array are sorted in a descending order "no" - otherwise You can assume the array will always be valid, and there will always be one correct answer. Solution: def is_sorted_and_how(arr): ..
Your task is to find the first element of an array that is not consecutive. By not consecutive we mean not exactly 1 larger than the previous element of the array. E.g. If we have an array [1,2,3,4,6,7,8] then 1 then 2 then 3 then 4 are all consecutive but 6 is not, so that's the first non-consecutive number. If the whole array is consecutive then return null2. The array will always have at leas..