일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 반복문
- predictive analysis
- assignment operator
- const
- 알고리즘
- Object Oriented Programming
- 문자열
- pass by reference
- string
- 백준
- Class
- Data Science
- Python
- 파이썬
- programming
- pointer
- 포인터
- function
- 티스토리챌린지
- OOP
- baekjoon
- Pre-processing
- Deep Learning
- array
- 함수
- raw data
- vscode
- C++
- 오블완
- 배열
- Today
- Total
목록python (16)
Channi Studies
tuple: An immutable sequence similar to a list.triple = (5, 10, 15)triple2 = 5, 10, 15When creating a tuple, you can either use or omit the paranthesis. 이 글에서는 튜플이 파이썬에서 사용되는 몇가지 간단한 예를 알아보겠습니다. 파이썬에서는 여러개의 인자를 입력받는 함수들이 존재합니다. 예를 들면 sum 함수가 있습니다. a = sum(1, 3) # Set a = 4b = sum(1, 3, 5, 7) # Set b = 16보시다시피 2개, 4개, 또는 그 이상의 인자를 입력 받습니다. 이러한 sum 함수를 직접 구현하자면, asterisk (*) 를 사용합니다.def sum(*val..
Listlist: A mutable sequence* that grows or shrinks dynamically as new elements are added or removed.*sequence: A container that stores a collection of values that can be accessed by an integer index. (string, list, …) Use SQUARE BRACKETS [ ] to create a list. ex) values = [32, 54, 67.5, 80, 110, 44.5] # A list with 6 elements Another way to create a list: values = [4] sets values to the list..
파이썬으로 기초적인 프로그램을 프로그래밍 하다 보면, 오류를 핸들링 해야 하는 경우가 많습니다. When user enters invalid input, it is common to abort the program. 그렇게 하기 위해서는, sys standard library module에 정의된 exit 함수를 사용하면 됩니다. from sys import exitif not (userResponse == "n" or userResponse == "y"): exit("Error: you must enter either n or y.") exit(errorMessage) 형식으로 프로그램 terminate 시에 출력될 에러 메시지를 인자로 넣으면 됩니다.

There are some ways in Python to analyze string. substring in sReturns True if the string s contains substring and False otherwise.if "-" is not in name: ...s.count(substring)Returns the number of non-overlapping occurrences of substring in s.s.endswith(substring)Returns True if the string s ends with the substring and False otherwise.s.startswith(substring)Returns True if the string s starts w..