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}")
'Development > Python' 카테고리의 다른 글
Test-time-computing에 대하여 (허깅페이스 블로그 포스트 정리) (0) | 2025.03.27 |
---|---|
[코딩테스트#1] 기초 자료 구조: 배열, 문자열, 스택, 큐 (1) | 2024.06.23 |
[파이썬 부트캠프 #2] 데이터 형식의 이해 및 문자열 조작 방법 (1) | 2023.09.03 |