diff --git a/korean/03_Day_Operators/03_operators.md b/korean/03_Day_Operators/03_operators.md index d54c498..e50972f 100644 --- a/korean/03_Day_Operators/03_operators.md +++ b/korean/03_Day_Operators/03_operators.md @@ -20,11 +20,11 @@ - [๐Ÿ“˜ 3์ผ์ฐจ](#3์ผ์ฐจ) - [๋ถˆ๋ฆฌ์–ธ](#๋ถˆ๋ฆฌ์–ธ) - [์—ฐ์‚ฐ์ž](#์—ฐ์‚ฐ์ž) - - [๋Œ€์ž… ์—ฐ์‚ฐ์ž](#๋Œ€์ž… ์—ฐ์‚ฐ์ž) - - [์‚ฐ์ˆ  ์—ฐ์‚ฐ์ž:](#์‚ฐ์ˆ  ์—ฐ์‚ฐ์ž) - - [๋น„๊ต ์—ฐ์‚ฐ์ž](#๋น„๊ต ์—ฐ์‚ฐ์ž) - - [๋…ผ๋ฆฌ ์—ฐ์‚ฐ์ž](#๋…ผ๋ฆฌ ์—ฐ์‚ฐ์ž) - - [๐Ÿ’ป 3์ผ์ฐจ: ์‹ค์Šต](#3์ผ์ฐจ: ์‹ค์Šต) + - [๋Œ€์ž… ์—ฐ์‚ฐ์ž](#๋Œ€์ž…-์—ฐ์‚ฐ์ž) + - [์‚ฐ์ˆ  ์—ฐ์‚ฐ์ž:](#์‚ฐ์ˆ -์—ฐ์‚ฐ์ž) + - [๋น„๊ต ์—ฐ์‚ฐ์ž](#๋น„๊ต-์—ฐ์‚ฐ์ž) + - [๋…ผ๋ฆฌ ์—ฐ์‚ฐ์ž](#๋…ผ๋ฆฌ-์—ฐ์‚ฐ์ž) + - [๐Ÿ’ป 3์ผ์ฐจ: ์‹ค์Šต](3์ผ์ฐจ:-์‹ค์Šต) # ๐Ÿ“˜ 3์ผ์ฐจ @@ -179,83 +179,83 @@ density = mass / volume # 1000 Kg/m^3 ### ๋น„๊ต ์—ฐ์‚ฐ์ž -In programming we compare values, we use comparison operators to compare two values. We check if a value is greater or less or equal to other value. The following table shows Python comparison operators which was taken from [w3shool](https://www.w3schools.com/python/python_operators.asp). +ํ”„๋กœ๊ทธ๋ž˜๋ฐ์—์„œ ์šฐ๋ฆฌ๋Š” ๋น„๊ต ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋‘ ๊ฐ’์„ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ๊ฐ’์ด ๋‹ค๋ฅธ ๊ฐ’๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ ํ‘œ๋Š”[w3shool](https://www.w3schools.com/python/python_operators.asp)์—์„œ ๊ฐ€์ ธ์˜จ ํŒŒ์ด์ฌ์˜ ๋น„๊ต ์—ฐ์‚ฐ์ž๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ![Comparison Operators](../images/comparison_operators.png) -**Example: Comparison Operators** +**Example: ๋น„๊ต ์—ฐ์‚ฐ์ž** ```py -print(3 > 2) # True, because 3 is greater than 2 -print(3 >= 2) # True, because 3 is greater than 2 -print(3 < 2) # False, because 3 is greater than 2 -print(2 < 3) # True, because 2 is less than 3 -print(2 <= 3) # True, because 2 is less than 3 -print(3 == 2) # False, because 3 is not equal to 2 -print(3 != 2) # True, because 3 is not equal to 2 -print(len('mango') == len('avocado')) # False -print(len('mango') != len('avocado')) # True -print(len('mango') < len('avocado')) # True -print(len('milk') != len('meat')) # False -print(len('milk') == len('meat')) # True -print(len('tomato') == len('potato')) # True -print(len('python') > len('dragon')) # False +print(3 > 2) # ์ฐธ, 3์ด 2๋ณด๋‹ค ํฌ๊ธฐ ๋•Œ๋ฌธ์— +print(3 >= 2) # ์ฐธ, 3์ด 2๋ณด๋‹ค ํฌ๊ธฐ ๋•Œ๋ฌธ์— +print(3 < 2) # ๊ฑฐ์ง“, 3์ด ๋” ํฌ๊ธฐ ๋•Œ๋ฌธ์— +print(2 < 3) # ์ฐธ, 2๊ฐ€ 3๋ณด๋‹ค ์ž‘๊ธฐ ๋•Œ๋ฌธ์— +print(2 <= 3) # ์ฐธ, 2๊ฐ€ 3๋ณด๋‹ค ์ž‘๊ธฐ ๋•Œ๋ฌธ์— +print(3 == 2) # ๊ฑฐ์ง“, 3๊ณผ 2๋Š” ๊ฐ™์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— +print(3 != 2) # ์ฐธ, 3์€ 2์™€ ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— +print(len('mango') == len('avocado')) # ๊ฑฐ์ง“ +print(len('mango') != len('avocado')) # ์ฐธ +print(len('mango') < len('avocado')) # ์ฐธ +print(len('milk') != len('meat')) # ๊ฑฐ์ง“ +print(len('milk') == len('meat')) # ์ฐธ +print(len('tomato') == len('potato')) # ์ฐธ +print(len('python') > len('dragon')) # ๊ฑฐ์ง“ -# Comparing something gives either a True or False +# ๋ฌด์–ธ๊ฐ€๋ฅผ ๋น„๊ตํ•˜๋ฉด ์ฐธ ๋˜๋Š” ๊ฑฐ์ง“์ด ๋ฉ๋‹ˆ๋‹ค. print('True == True: ', True == True) print('True == False: ', True == False) print('False == False:', False == False) ``` -In addition to the above comparison operator Python uses: +์œ„์˜ ๋น„๊ต ์—ฐ์‚ฐ์ž ์™ธ์— ํŒŒ์ด์ฌ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค: -- _is_: Returns true if both variables are the same object(x is y) -- _is not_: Returns true if both variables are not the same object(x is not y) -- _in_: Returns True if the queried list contains a certain item(x in y) -- _not in_: Returns True if the queried list doesn't have a certain item(x in y) +- _is_: ๋‘ ๋ณ€์ˆ˜๊ฐ€ ๋™์ผํ•  ๊ฒฝ์šฐ ์ฐธ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.(x is y) +- _is not_: ๋‘ ๋ณ€์ˆ˜๊ฐ€ ๋™์ผํ•˜์ง€ ์•Š์„ ๊ฒฝ์šฐ ์ฐธ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.(x is not y) +- _in_: ์ œ์‹œ๋œ ๋ชฉ๋ก์— ํŠน์ • ํ•ญ๋ชฉ์ด ํฌํ•จ๋œ ๊ฒฝ์šฐ ์ฐธ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.(x in y) +- _not in_: ์ œ์‹œ๋œ ๋ชฉ๋ก์— ํŠน์ • ํ•ญ๋ชฉ์ด ์—†์œผ๋ฉด ์ฐธ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.(x in y) ```py -print('1 is 1', 1 is 1) # True - because the data values are the same -print('1 is not 2', 1 is not 2) # True - because 1 is not 2 -print('A in Asabeneh', 'A' in 'Asabeneh') # True - A found in the string -print('B in Asabeneh', 'B' in 'Asabeneh') # False - there is no uppercase B -print('coding' in 'coding for all') # True - because coding for all has the word coding -print('a in an:', 'a' in 'an') # True -print('4 is 2 ** 2:', 4 is 2 ** 2) # True +print('1 is 1', 1 is 1) # ์ฐธ - ๋ฐ์ดํ„ฐ ๊ฐ’์ด ๋™์ผํ•˜๊ธฐ ๋•Œ๋ฌธ์— +print('1 is not 2', 1 is not 2) # ์ฐธ - 1๊ณผ 2๋Š” ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— +print('A in Asabeneh', 'A' in 'Asabeneh') # ์ฐธ - ๋ฌธ์ž์—ด์—์„œ A๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค +print('B in Asabeneh', 'B' in 'Asabeneh') # ๊ฑฐ์ง“ - ๋Œ€๋ฌธ์ž B๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค +print('coding' in 'coding for all') # ์ฐธ - coding์ด๋ผ๋Š” ๋‹จ์–ด๋ฅผ coding for all์ด ๊ฐ€์ง€๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— +print('a in an:', 'a' in 'an') # ์ฐธ +print('4 is 2 ** 2:', 4 is 2 ** 2) # ์ฐธ ``` -### Logical Operators +### ๋…ผ๋ฆฌ ์—ฐ์‚ฐ์ž -Unlike other programming languages python uses keywords _and_, _or_ and _not_ for logical operators. Logical operators are used to combine conditional statements: +๋‹ค๋ฅธ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์™€ ๋‹ฌ๋ฆฌ ํŒŒ์ด์ฌ์€ ๋…ผ๋ฆฌ ์—ฐ์‚ฐ์ž๋ฅผ ์œ„ํ•ด _and_, _or_, _not_ ํ‚ค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋…ผ๋ฆฌ ์—ฐ์‚ฐ์ž๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์กฐ๊ฑด๋ฌธ์„ ๊ฒฐํ•ฉํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ![Logical Operators](../images/logical_operators.png) ```py -print(3 > 2 and 4 > 3) # True - because both statements are true -print(3 > 2 and 4 < 3) # False - because the second statement is false -print(3 < 2 and 4 < 3) # False - because both statements are false +print(3 > 2 and 4 > 3) # ์ฐธ - ๋‘ ๊ฐœ์˜ ๋ฌธ์žฅ์ด ์ฐธ์ด๊ธฐ ๋•Œ๋ฌธ์— +print(3 > 2 and 4 < 3) # ๊ฑฐ์ง“ - ๋‘ ๋ฒˆ์งธ ๋ฌธ์žฅ์ด ๊ฑฐ์ง“์ด๊ธฐ ๋•Œ๋ฌธ์— +print(3 < 2 and 4 < 3) # ๊ฑฐ์ง“ - ๋‘ ๊ฐ€์ง€ ๋ฌธ์žฅ ๋ชจ๋‘ ๊ฑฐ์ง“์ด๊ธฐ ๋•Œ๋ฌธ์— print('True and True: ', True and True) -print(3 > 2 or 4 > 3) # True - because both statements are true -print(3 > 2 or 4 < 3) # True - because one of the statements is true -print(3 < 2 or 4 < 3) # False - because both statements are false +print(3 > 2 or 4 > 3) # ์ฐธ - ๋‘ ๊ฐ€์ง€ ๋ฌธ์žฅ ๋ชจ๋‘ ์ฐธ์ด๊ธฐ ๋•Œ๋ฌธ์— +print(3 > 2 or 4 < 3) # ์ฐธ - ๋‘ ๊ฐ€์ง€ ์ค‘ ํ•˜๋‚˜์˜ ๋ฌธ์žฅ์ด ์ฐธ์ด๊ธฐ ๋•Œ๋ฌธ์— +print(3 < 2 or 4 < 3) # ๊ฑฐ์ง“ - ๋‘ ๊ฐ€์ง€ ๋ฌธ์žฅ ๋ชจ๋‘ ๊ฑฐ์ง“์ด๊ธฐ ๋•Œ๋ฌธ์— print('True or False:', True or False) -print(not 3 > 2) # False - because 3 > 2 is true, then not True gives False -print(not True) # False - Negation, the not operator turns true to false +print(not 3 > 2) # ๊ฑฐ์ง“ - 3์ด 2๋ณด๋‹ค ํฐ ๊ฒƒ์€ ์ฐธ์ด๊ธฐ ๋•Œ๋ฌธ์—, ์ฐธ์ด ์•„๋‹ ๊ฒฝ์šฐ ๊ฑฐ์ง“์„ ์ค๋‹ˆ๋‹ค. +print(not True) # ๊ฑฐ์ง“ - ๋ถ€์ •์œผ๋กœ ์ฐธ์—์„œ ๊ฑฐ์ง“์œผ๋กœ ๋ฐ”๋€๋‹ˆ๋‹ค. print(not False) # True print(not not True) # True print(not not False) # False ``` -๐ŸŒ• You have boundless energy. You have just completed day 3 challenges and you are three steps ahead on your way to greatness. Now do some exercises for your brain and your muscles. +๐ŸŒ• ๋‹น์‹ ์€ ๋ฌดํ•œํ•œ ์—๋„ˆ์ง€๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์–ด์š”. ์—ฌ๋Ÿฌ๋ถ„์€ ์ด์ œ ๋ง‰ 3์ผ์ฐจ ๋„์ „์„ ๋งˆ์ณค๊ณ  ์œ„๋Œ€ํ•จ์œผ๋กœ ๊ฐ€๋Š” ๊ธธ์— ์„ธ ๊ฑธ์Œ ์•ž์„œ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์ œ ์—ฌ๋Ÿฌ๋ถ„์˜ ๋‡Œ์™€ ๊ทผ์œก์„ ์œ„ํ•œ ์šด๋™์„ ํ•˜์„ธ์š”. -## ๐Ÿ’ป Exercises - Day 3 +## ๐Ÿ’ป 3์ผ์ฐจ: ์‹ค์Šต -1. Declare your age as integer variable -2. Declare your height as a float variable -3. Declare a variable that store a complex number -4. Write a script that prompts the user to enter base and height of the triangle and calculate an area of this triangle (area = 0.5 x b x h). +1. ๋‚˜์ด๋ฅผ ์ •์ˆ˜ ๋ณ€์ˆ˜๋กœ ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค. +2. ์ž์‹ ์˜ ํ‚ค๋ฅผ ํ”Œ๋กœํŠธ ๋ณ€์ˆ˜๋กœ ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค. +3. ๋ณต์†Œ์ˆ˜๋ฅผ ์ €์žฅํ•˜๋Š” ๋ณ€์ˆ˜ ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค. +4. ์‚ผ๊ฐํ˜•์˜ ๋ฐ‘๋ฉด๊ณผ ๋†’์ด๋ฅผ ์ž…๋ ฅํ•˜๋„๋ก ์‚ฌ์šฉ์ž์—๊ฒŒ ์ง€์‹œํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ์ด ์‚ผ๊ฐํ˜•์˜ ๋ฉด์ (๋ฉด์  = 0.5 x b x h)์„ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ```py Enter base: 20 @@ -263,7 +263,7 @@ print(not not False) # False The area of the triangle is 100 ``` -5. Write a script that prompts the user to enter side a, side b, and side c of the triangle. Calculate the perimeter of the triangle (perimeter = a + b + c). +5. ์‚ผ๊ฐํ˜•์˜ ์ธก๋ฉด a, ์ธก๋ฉด b, ์ธก๋ฉด c๋ฅผ ์ž…๋ ฅํ•˜๋ผ๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ํ‘œ์‹œํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. ์‚ผ๊ฐํ˜•์˜ ๋‘˜๋ ˆ(์ง€๋ฆ„ = a + b + c)๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ```py Enter side a: 5 @@ -272,22 +272,22 @@ Enter side c: 3 The perimeter of the triangle is 12 ``` -6. Get length and width of a rectangle using prompt. Calculate its area (area = length x width) and perimeter (perimeter = 2 x (length + width)) -7. Get radius of a circle using prompt. Calculate the area (area = pi x r x r) and circumference (c = 2 x pi x r) where pi = 3.14. -8. Calculate the slope, x-intercept and y-intercept of y = 2x -2 -9. Slope is (m = y2-y1/x2-x1). Find the slope and [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance#:~:text=In%20mathematics%2C%20the%20Euclidean%20distance,being%20called%20the%20Pythagorean%20distance.) between point (2, 2) and point (6,10) -10. Compare the slopes in tasks 8 and 9. -11. Calculate the value of y (y = x^2 + 6x + 9). Try to use different x values and figure out at what x value y is going to be 0. -12. Find the length of 'python' and 'dragon' and make a falsy comparison statement. -13. Use _and_ operator to check if 'on' is found in both 'python' and 'dragon' -14. _I hope this course is not full of jargon_. Use _in_ operator to check if _jargon_ is in the sentence. -15. There is no 'on' in both dragon and python -16. Find the length of the text _python_ and convert the value to float and convert it to string -17. Even numbers are divisible by 2 and the remainder is zero. How do you check if a number is even or not using python? -18. Check if the floor division of 7 by 3 is equal to the int converted value of 2.7. -19. Check if type of '10' is equal to type of 10 -20. Check if int('9.8') is equal to 10 -21. Writ a script that prompts the user to enter hours and rate per hour. Calculate pay of the person? +6. ํ”„๋กฌํ”„ํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ง์‚ฌ๊ฐํ˜•์˜ ๊ธธ์ด์™€ ๋„ˆ๋น„๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. ๋ฉด์ (๋ฉด์  = ๊ธธ์ด x ํญ) ๋ฐ ๋‘˜๋ ˆ(๋ฉด์  = 2 x (๊ธธ์ด + ํญ)) ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. +7. ํ”„๋กฌํ”„ํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์›์˜ ๋ฐ˜์ง€๋ฆ„์„ ๊ตฌํ•ฉ๋‹ˆ๋‹ค. ๋ฉด์ (๋ฉด์  = ํ”ฝ์Šค r x r)๊ณผ ์›์ฃผ(c = 2 x ํ”ฝ์Šค r)๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ pi = 3.14์ž…๋‹ˆ๋‹ค. +8. y = 2x-2์˜ ๊ธฐ์šธ๊ธฐ, x-์ œ๊ณฑ ๋ฐ y-์ œ๊ณฑ์„ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. +9. ๊ธฐ์šธ๊ธฐ๋Š” (m = y2-y1/x2-x1)์ž…๋‹ˆ๋‹ค. ๊ธฐ์šธ๊ธฐ์™€ [์œ ํด๋ฆฌ๋“œ ๊ฑฐ๋ฆฌ](https://en.wikipedia.org/wiki/Euclidean_distance#:~:text=In%20mathematics%2C%20the%20Euclidean%20distance,being%20called%20the%20Pythagorean%20distance.) ์ (2,2)๊ณผ ์ (6,10) ์‚ฌ์ด๋ฅผ ๊ตฌํ•ฉ๋‹ˆ๋‹ค. +10. ๊ณผ์ œ 8๊ณผ 9์˜ ๊ธฐ์šธ๊ธฐ๋ฅผ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค. +11. y ๊ฐ’(y = x^2 + 6x + 9)์„ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ x ๊ฐ’์„ ์‚ฌ์šฉํ•˜๊ณ  y ๊ฐ’์ด 0์ด ๋˜๋Š” x ๊ฐ’์„ ๊ณ„์‚ฐํ•ด ๋ณด์‹ญ์‹œ์˜ค. +12. 'python'๊ณผ 'dragon'์˜ ๊ธธ์ด๋ฅผ ์ฐพ์•„ ๊ฑฐ์ง“ ๋น„๊ต๋ฅผ ํ•ฉ๋‹ˆ๋‹ค. +13. _and_ ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ 'python'๊ณผ 'dragon' ๋ชจ๋‘์— 'on'์ด ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. +14. _๋‚˜๋Š” ์ด ๊ฐ•์ขŒ๊ฐ€ ์ „๋ฌธ์šฉ์–ด๋กœ ๊ฐ€๋“ํ•˜์ง€ ์•Š๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค. _in_ ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ _jargon_ ์ด ๋ฌธ์žฅ์— ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. +15. dragon๊ณผ python ๋ชจ๋‘ 'On'์ด ์—†์Šต๋‹ˆ๋‹ค. +16. _python_ ํ…์ŠคํŠธ์˜ ๊ธธ์ด๋ฅผ ์ฐพ์•„์„œ ๊ฐ’์„ float๋กœ ๋ณ€ํ™˜ํ•˜๊ณ  ๋ฌธ์ž์—ด๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค. +17. ์ง์ˆ˜๋Š” 2๋กœ ๋‚˜๋ˆ„๊ณ  ๋‚˜๋จธ์ง€๋Š” 0์ž…๋‹ˆ๋‹ค. ํŒŒ์ด์ฌ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ˆซ์ž๊ฐ€ ์ง์ˆ˜์ธ์ง€ ์•„๋‹Œ์ง€ ์–ด๋–ป๊ฒŒ ํ™•์ธํ•ฉ๋‹ˆ๊นŒ? +18. 7 x 3์˜ ๋‚˜๋ˆ—์…ˆ ๋ฒ„๋ฆผ์ด 2.7์˜ int ๋ณ€ํ™˜๊ฐ’๊ณผ ๋™์ผํ•œ์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. +19. '10'์˜ ์œ ํ˜•์ด 10์˜ ์œ ํ˜•๊ณผ ๋™์ผํ•œ์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. +20. if int('9)๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.8')๋Š” 10๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. +21. ์‚ฌ์šฉ์ž์—๊ฒŒ ์‹œ๊ฐ„ ๋ฐ ์‹œ๊ฐ„๋‹น ์š”๊ธˆ์„ ์ž…๋ ฅํ•˜๋„๋ก ์š”์ฒญํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. ๊ทธ ์‚ฌ๋žŒ์˜ ๊ธ‰์—ฌ๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๊นŒ? ```py Enter hours: 40 @@ -295,14 +295,14 @@ Enter rate per hour: 28 Your weekly earning is 1120 ``` -22. Write a script that prompts the user to enter number of years. Calculate the number of seconds a person can live. Assume a person can live hundred years +22. ์‚ฌ์šฉ์ž์—๊ฒŒ ๋…„ ์ˆ˜๋ฅผ ์ž…๋ ฅํ•˜๋„๋ก ์š”์ฒญํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ๋žŒ์ด ์‚ด ์ˆ˜ ์žˆ๋Š” ์‹œ๊ฐ„์„ ์ดˆ ๋‹จ์œ„๋กœ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ๋žŒ์ด 100๋…„์„ ์‚ด ์ˆ˜ ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ์‹œ๋‹ค. ```py Enter number of years you have lived: 100 You have lived for 3153600000 seconds. ``` -23. Write a Python script that displays the following table +23. ๋‹ค์Œ์„ ํ‘œ์‹œํ•˜๋Š” ํŒŒ์ด์ฌ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. ```py 1 1 1 1 1 @@ -312,6 +312,6 @@ You have lived for 3153600000 seconds. 5 1 5 25 125 ``` -๐ŸŽ‰ CONGRATULATIONS ! ๐ŸŽ‰ +๐ŸŽ‰ ์ถ•ํ•˜ํ•ฉ๋‹ˆ๋‹ค ! ๐ŸŽ‰ [<< Day 2](../02_Day_Variables_builtin_functions/02_variables_builtin_functions.md) | [Day 4 >>](../04_Day_Strings/04_strings.md)