Code Monkey home page Code Monkey logo

python's Introduction

Intro

Requirement

  1. 에디터 셋업 (pycharm)
    1. pycharm 설치방법
      1. https://www.jetbrains.com/pycharm/download/?section=mac
      2. 커뮤니티 .dmg 애플 실리콘
  2. python 설치 (pyenv)
    1. 의존성 패키지 설치 brew install openssl readline sqlite xz zlib
    2. pyenv 설치 brew install pyenv
    3. pipenv 설치 brew install pipenv
    4. pyenv-virtualenv 설치 brew install pyenv-virtualenv

Hello World

  1. Hello World 작성
print("Hello World")

Variable

What is variable or constant?

python? 그냥 쓰면 돼

  1. variable
a = 10
b = '안녕하세요'
c = 0.1
d = True
  1. constant 상수가 따로 없음

Type

  1. int
  2. float
  3. bool
  4. str
a = 10
b = 0.1
c = '안녕하세요'
d = True

Operation

basic operation

  1. +
  2. -
  3. *
  4. /
  5. % (나머지)

compare operation

  1. >, <
  2. >=, <=
  3. ==, is, !=, is not
  4. and
  5. or
  6. not

complex assignment operation

  1. +=
  2. -=
  3. *=
  4. /=
  5. %=

대입 연산자

  1. =

Print and Scan

Print

  1. print
  2. f-string
print("Hello World")
a = 10
print(f"a: {a}")

Input

  1. input
a = input()

Conditional

if

  1. if
  2. else
  3. elif

Loop

while

  1. while
  2. break
  3. continue

for

  1. for

Array

one dimension array

  1. []

two dimension array

  1. [][]

Function

basic function

  1. name, parameters, default value
def myFunction(a, b=10):
	print("This is my function!")
  1. variable lifecycle
  2. named parameters
  3. index parameters

class

basic class

  1. class
class Book:
	def __init__(self, a, b):
		self.a = a
		self.b = b
	
	def add(self):
		return self.a + self.b

book = Book(10, 20)
print(book.add())

python's People

Contributors

kyu1204 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.