PYTHON

UDEMY | 100DAYS OF CODE - day1

성장하는 쿠키의 로그 기록 2024. 12. 2. 16:11

 INPUT/ PRINT

-  PRINT & INPUT 중첩 일 때, INPUT 반환 후 → PRINT 문으로 출력 됨 

print("hello" + input("what is your name?") +"!" )

2개의 변수 스위칭 하기 

- 2개의 변수 값을 바꿀 때는, 변수 한개 더 선언하고 바꿔 줌. 

a= 'cookiee'
b= 'bagle'


c = a
a = b
b = c

print(a,b)

📂미니 프로젝트 : 밴드 이름 생성기 만들기

print("Welcome to the Band Name Generator.")
city = input("what's the name of the city you grew up in? \n")
pet_name = input("what is your pet's name? \n")

print("your band name could be",city,pet_name)