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
- WECODE
- lambda
- join
- Sorted
- Python
- enumerate
- 위코드
- MAX
- map
- DART
- js
- or
- index
- split
- SQL
- Algorithm
- LOWER
- and
- STR
- count
- range
- list
- If
- len
- decorator
- FOR
- slice
- 파이썬
- iNT
- sum
Archives
- Today
- Total
코드로 우주평화
0115. Name on billboard 본문
You can print your name on a billboard ad. Find out how much it will cost you. Each character has a default price of £30, but that can be different if you are given 2 parameters instead of 1.
You can not use multiplier "*" operator.
If your name would be Jeong-Ho Aristotelis, ad would cost £600. 20 leters * 30 = 600 (Space counts as a character).
Solution:
def billboard(name, price=30):
return sum(price for _ in name)
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
0117. get character from ASCII Value (0) | 2023.01.18 |
---|---|
0116. OOP: Object Oriented Piracy (0) | 2023.01.16 |
0114. Are arrow functions odd? (0) | 2023.01.15 |
0113. Build a square (0) | 2023.01.13 |
0112. Tip Calculator (0) | 2023.01.13 |