๐Ÿ“˜Python/๐Ÿ‘ฉ‍๐Ÿซclass

๐Ÿ‘ฉ‍๐Ÿซclass : 2week

4:Bee 2023. 9. 5. 16:00
728x90

test import turtle package

import turtle

t = turtle.Turtle()

t.color("blue")
t.goto(100,50)
t.circle(50)

์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•œ ๊ฒฐ๊ณผ์˜ ์ด๋ฏธ์ง€์ด๋‹ค.


print to variable

#variable print
a = "Python"
b = 10
print(a)
print(b)


์ดํ›„ ๊ธฐํƒ€ ์ฝ”๋“œ๋“ค์ด๋‹ค. ์–ด๋ ต์ง€ ์•Š์•„ ๋”ฐ๋กœ ์ฝ”๋“œ๋ฅผ ๋นผ๋†“์ง€ ์•Š์•˜๋‹ค.

data type

#data type
print("data type")
print(7+7)
print('7'+"7")

#str -> array
print("\nstr -> array")
msg = "Hello Python"
print(msg[0])
print(msg[6:8])
print(msg[11])  #n
print(msg[-1])  #n
print(msg[2:5]) #llo

 

[Python turtle] 01. ํŒŒ์ด์ฌ ํ„ฐํ‹€์ด๋ž€? & ํ„ฐํ‹€ ์‚ฌ์šฉ๋ฒ•

1. Python turtle (ํŒŒ์ด์ฌ ํ„ฐํ‹€) ์ด๋ž€? ํŒŒ์ด์ฌ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๊ทธ๋ž˜ํ”ฝ ๋ชจ๋“ˆ์ž…๋‹ˆ๋‹ค. ํ„ฐํ‹€(๊ฑฐ๋ถ์ด) ๋ชจ์–‘์˜ ์ปค์„œ๊ฐ€ ์ง€๋‚˜๊ฐ„ ํ”์ ์„ ์ด์šฉํ•˜์—ฌ ํ™”๋ฉด์— ๊ทธ๋ฆผ์„ ๊ทธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 2. turtle ์‹คํ–‰ํ™˜๊ฒฝ ํŒŒ์ด์ฌ

kariu.tistory.com

 

728x90