일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- google apps script
- Google Excel
- Google Spreadsheet
- gas
- SQL
- Mac
- string
- PySpark
- django
- 파이썬
- Python
- matplotlib
- numpy
- hive
- dataframe
- array
- PANDAS
- GIT
- Kotlin
- Excel
- Redshift
- Java
- math
- list
- c#
- Apache
- Tkinter
- PostgreSQL
- Github
- Today
- Total
목록case (5)
달나라 노트
switch ~ case ~ default 구문은 if ~ else if ~ else 조건문을 좀 더 간결하게 사용할 수 있는 구문입니다. 간결하게 사용할 수 있다는 장점 때문에 특정 상황에서는 switch ~ case ~ default 구문이 if ~ else if ~ else 구문보다 좀 더 코드를 더 적게 써도 조건문을 구현할 수 있다는 장점이 있습니다. 반대로 간결하게 사용할 수 있기 때문에 더 복잡한 기능에 대한 구현은 switch ~ case ~ default 구문으로는 불가능한 경우도 있습니다. Syntax switch (value) { case value1: ... do something 1 ... case value2: ... do something 2 ... case value3: ....
islower() method는 string에 적용할 수 있으며, 문자열에 포함된 모든 알파벳이 모두 소문자일 경우 True를 return합니다. 문자열에 포함된 알파벳 중 하나라도 대문자일 경우 False를 return합니다. isupper() method는 string에 적용할 수 있으며, 문자열에 포함된 모든 알파벳이 모두 대문자일 경우 True를 return합니다. 문자열에 포함된 알파벳 중 하나라도 소문자일 경우 False를 return합니다. Syntax string.islower() string.isupper() 사용법은 간단합니다. 두 method 모두 그냥 string에 적용하면 됩니다. str_test = 'abcde' print(str_test.islower()) -- Result T..
switch 구문은 아래와 같이 사용할 수 있습니다. switch (main_value) { case value1: main_value = value1 일때 실행할 부분 case value2: main_value = value2 일때 실행할 부분 ... default: main_value랑 동일한 부분이 하나도 없을 때 실행할 부분 } using System; class MyProgram { static void Main() { int test1 = 5; switch (test1) { case 1: Console.WriteLine("test1 = 1"); break; case 2: Console.WriteLine("test1 = 2"); break; case 3: Console.WriteLine("tes..
switch 구문은 아래와 같이 사용할 수 있습니다. switch (main_value) { case value1: main_value = value1 일때 실행할 부분 case value2: main_value = value2 일때 실행할 부분 ... default: main_value랑 동일한 부분이 하나도 없을 때 실행할 부분 } #include using namespace std; int main() { int test_1 = 5; switch (test_1) { case 1: cout