본문 바로가기
Development/Python

[파이썬 부트캠프 #1] 파이썬 변수를 사용한 데이터 관리

by 남디윤 2023. 7. 28.

1일차부터 듣기 시작했습니다.

앞부분 들었다가 너무 쉽나 싶어서 15일 중급으로 넘어갔다가 예시 코드랑 너무 실력차이?가 나는듯 하여 다시 1일차로 회귀 ^^;;

 

띄엄띄엄 작성한 코드만 복붙합니다.

그냥 공부 기록일뿐..

 

 

8. 문자열 처리와 지능형 코드

print("Hello world!\nHello world!")
print("Hello" + " " + "Angela")
  • IndentationError: 띄어쓰기, 들여쓰기 에러
  • SyntaxError: 문법에러

 

 

10. 파이썬 입력 함수

input("what is your name?")
print(len(input("what is your name?: ")))

 

 

12. 파이썬 변수

name="Angela"
print(name)

 

 

13. [대화형 코딩 연습]변수

a=input("a: ")
b=input("b: ")
tmp=a
a=b
b=tmp
print("a: ", a)
print("b: ", b)

 

 

15. 1일차 프로젝트: 밴드명 생성기

#1. Create a greeting for your program.
print("Welcome to the Band Name Generator")

#2. Ask the user for the city that they grew up in.
city=input("What's name of the city you grew up in?\n")

#3. Ask the user for the name of a pet.
pet=input("What's your pet's name?\n")

#4. Combine the name of their city and pet and show them their band name.
band_name=city+" "+pet

#5. Make sure the input cursor shows on a new line:
print(f"Your band name could be {band_name}")