파이썬에서는 변수에 숫자와 텍스트를 넣을 수 있다.
x = 2
price = 2.5
word = 'Hello'
변수에는 공백이나 특수문자를 쓸 수 없다. 변수를 정의하는 3가지 예
word = 'Hello'
word = "Hello"
word = '''Hello'''
변수는 재 정의가 가능하다.
x = 2
# increase x by one
x = x + 1
# replace x
x = 5
'프로그래밍 > Python' 카테고리의 다른 글
Python Tutorial : While loop [5] (0) | 2016.04.15 |
---|---|
Python Tutorial : For loops [4] (0) | 2016.04.15 |
Python Tutorial : If statements [2] (0) | 2016.04.15 |
Python Tutorial : Text input and output [1] (0) | 2016.04.15 |
파이썬 기초 - Python이란? (0) | 2016.04.14 |