Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- iNT
- list
- WECODE
- decorator
- js
- range
- SQL
- MAX
- map
- join
- Sorted
- 위코드
- or
- LOWER
- split
- DART
- enumerate
- STR
- len
- and
- slice
- FOR
- Python
- 파이썬
- sum
- lambda
- Algorithm
- count
- index
- If
Archives
- Today
- Total
코드로 우주평화
Beginner - Lost Without a Map 본문
Description:
Given an array of integers, return a new array with each value doubled.
For example:
[1, 2, 3] --> [2, 4, 6]
Solution:
1. Get the elements out of the array.
2. Multiply the element by 2 and put it back into the array.
3. Return an array.
def maps(a):
return list(map(lambda x: x * 2, a))
The lambda function is an anonymous function and is suitable for simple calculations.
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
Total amount of points (0) | 2022.04.09 |
---|---|
Transportation on vacation (0) | 2022.04.08 |
Calculate average (0) | 2022.04.07 |
Hide Kata Description (0) | 2022.04.05 |
How Green Is My Valley? (0) | 2022.04.04 |