coding
-
[Python tutorial] 1. Introduction코딩/Python 2022. 12. 21. 17:10
Python, Guido van Rossum, 1991 사용목적 웹 개발(서버 측) 소프트웨어 개발 수학 시스템 스크립팅 파이썬은 무엇을 할 수 있나요? 서버에서 웹 애플리케이션을 생성. 소프트웨어와 함께 워크플로를 생성. 데이터베이스 시스템에 연결. 파일을 읽고 수정. 빅 데이터를 처리하고 복잡한 수학을 수행. 신속한 프로토타이핑 또는 생산 준비가 된 소프트웨어 개발용. 왜 파이썬인가? 다양한 플랫폼(Windows, Mac, Linux, Raspberry Pi 등)에서 작동. 영어와 유사한 간단한 구문 다른 프로그래밍 언어보다 적은 줄로 프로그램을 작성. 인터프리터 시스템에서 실행되므로 코드가 작성되자마자 실행. 이는 프로토타이핑이 매우 빠를 수 있음을 의미. 절차적 방식, 객체지향적 방식 또는 기능적..
-
Swift 정리 #7 클로저코딩/Swift 2022. 12. 14. 14:25
클로저 클로저는 전달되고 코드에서 사용될 수 있는 독립적인 기능 블록입니다. Swift의 클로저는 C 및 Objective-C의 블록과 다른 프로그래밍 언어의 람다와 유사합니다. 클로저는 정의된 컨텍스트에서 어떤 상수 및 변수에 대한 참조를 캡처하고 저장할 수 있습니다. 이것은 이러한 상수와 변수를 닫는다라는 것으로 알려져 있습니다. Swift는 캡처의 모든 메모리 관리를 처리합니다. Functions에서 소개된 전역 및 중첩 함수는 실제로 클로저의 특별한 경우입니다. 클로저는 다음 세 가지 형식 중 하나를 취합니다. 전역 함수는 이름이 있고 값을 캡처하지 않는 클로저 중첩 함수는 이름이 있고 둘러싸는 함수에서 값을 캡처할 수 있는 클로저 클로저 표현식은 주변 컨텍스트에서 값을 캡처할 수 있는 가벼운 구..
-
Swift 정리 #4 컬렉션 타입코딩/Swift 2022. 12. 14. 04:13
Arrays: ordered list Array Type Shorthand Syntax Array [Element] // shorthandCreating an Empty Array var someInts: [Int] = [] print("someInts is of type [Int] with \(someInts.count) items.") // Prints "someInts is of type [Int] with 0 items." someInts.append(3) // someInts now contains 1 value of type Int someInts = [] // someInts is now an empty array, but is still of type [Int]Creating an Arra..
-
Swift 정리 #3 문자열과 문자코딩/Swift 2022. 12. 13. 23:09
String Literals let someString = "Some string literal value"Multiline String Literals let quotation = """ The White Rabbit put on his spectacles. "Where shall I begin, please your Majesty?" he asked. "Begin at the beginning," the King said gravely, "and go on till you come to the end; then stop." """let singleLineString = "These are the same." let multilineString = """ These are the same. """// ..
-
Swift 정리 #2 연산자코딩/Swift 2022. 12. 13. 20:57
용어 단항연산자(Unary operator): 선행연산자(prefix, !b), 후행연산자(postfix, c!) 이항연산자(Binary operator): 2 + 3 삼항연산자(Ternary operator): 삼항조건연산자(ternary conditional operator, a ? b : c) Assignment Operator(지정연산자) = let b = 10 var a = 5 a = b // a is now equal to 10let (x, y) = (1, 2) // x is equal to 1, and y is equal to 2if x = y { // This isn't valid, because x = y doesn't return a value. }Compound Assi..