Jay's Another Memory

beginning python 01 : (파이썬 공부; python 学习) 본문

IT & Computer (컴퓨터,电脑)

beginning python 01 : (파이썬 공부; python 学习)

JayL 2023. 7. 16. 02:40

파이썬 공부하며 정리하고자 남김.

this is python self study record. 

 

파이썬 또는 파이썬 코드 입력 후 실행이 가능한 app 설치완료되어있어야 함. 

need to installed python or code reading APP already. 

 

 

code remark

case1) 

print ("our home bring animal dog his name is")
print(yti)
print("he has 4 years old")
print("and he likes walk")

after run code, can see inside " .... " content. 
if there's no changes, you can do like that, more simply.

case2) 

name = "yti"
animal = "dog"
age = 4
hobby = "walk"

print ("our home bring animal" + animal + " his name is")
print(name)
print("he has " + str(age) + " years old")
print("and he likes" + hobby)

if there's possibilties to change, 
need to you variable (변수,变数) 
so that can just changes main area, can changes whole result. 

remind))
1. text and var cannot use with. so change var -> str. 
2. if needs empty area, add in " " inside in advance. 
   *if use add contents by ","  then dont need use str().
 
case2-1)


name = "nabi"
animal = "cat"
age = 2
hobby = "ya woong"

print ("our home bring animal" + animal + " his name is")
print(name)
print("he has " + str(age) + " years old")
print("and he likes" + hobby)

completed change after revise black area. 

 

 

 

 

 

 

 

use , 

 

 

 

 

 

 

 

 

 

 

 

 

Comments