Variables for Strings
name = "송은우"
gender = "남자"
variable - name , gender
"송은우" - name , "남자" - gender의 변수값(value)
name 및 gender의 변수값은 바뀔 수 있어, Python 또한 변수값은 바뀔 수 있다.
## print vs variables
name = "송은우"
print(name) ## "송은우" 출력
(실제 문장에서의 특정단어를 뜻하여 문맥이 존재하나,
name은 이름을 뜻하는 단어여서 자동차 = 내이름 이라고 뜻할수 없지만,
Python에서는 그러한 문맥이 존재하지않아 name = "car"의 값을 저장할 수 있다.)
String
📌 "String" - 문자열(text) 값
📌 "" X - variables or function
- name
- _
name - 변수명앞에 숫자 불가
- my_
name - 언더바
- myName - 카멜표기법(*camelCase)
Variables For Numbers
var = 숫자 or "string"
숫자의 경우 Integer(정수) , Float(소숫점) , negative number(음수)
age = 23
next_year = age + 1
print(next_year) ## 24 출력