Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- plugin
- Windows 10
- profile
- Windows
- xargs
- 단축키
- port
- lsof
- Eclipse
- find
- 네트워크
- netsh
- Source
- import
- Quartz
- JavaScript
- Mac
- context
- web.xml
- vscode
- ssh
- resource
- 줄바꿈 문자
- VirtualBox
- IntelliJ
- bash
- GIT
- tomcat
- grep
- maVen
Archives
- Today
- Total
develog
[python] 설치, 실행, syntax 본문
python 설치
- https://www.python.org/downloads/
Download Python 3.9.5
version 확인
python --version
python 실행
python test.py
py test.py
comment
# line comment
"""
block comment
"""
function
# function 정의
def aa():
print("aa called")
# function 실행
aa()
# funciton 정의
def sum(a, b):
c = a + b
return c
# function 실행
print(sum(1, 2))
boolean
a = True
if a:
print("true")
a = False
if not a:
print("false")
a = True
b = True
if a == b:
print("all True")
uppercase, lowercase
print("Python".upper())
print("Python".lower())
string index
str = "aa.bb.txt"
firstIndex = str.find(".") + 1
lastIndex = str.rfind(".") + 1
print(firstIndex) # 3
print(lastIndex) # 6
print(str[firstIndex:]) # bb.txt
print(str[lastIndex:]) # txt
list length
list = ["aa", "bb", "cc"]
len = list.__len__() # 3
for i in range(0, len):
print(list[i])
"""
aa
bb
cc
"""
dictionary
dict = {
"name": "james",
"age": 20
}
print(dict) # {'name': 'james', 'age': 20}
Comments