100일 간의 코드: 2022년을 위한 완벽한 Python Pro 부트캠프 - 1일차(밴드 이름 생성기)

4531 단어
연습 1 - 인쇄

#Write your code below this line 👇
print("Day 1 - Python Print Function") 
print("The function is declared like this:")
print("print('what to print')") 


연습 2 - 디버깅 연습

#Fix the code below 👇
print("Day 1 - String Manipulation") 
print('String Concatenation is done with the "+" sign.')
print('e.g. print("Hello " + "world")')
print("New lines can be created with a backslash and n.")


연습 3 - 입력 기능

#Write your code below this line 👇
print(len(input("What is your name?")))


연습 4 - 변수

#🚨 Don't change the code below 👇
a = input("a: ")
b = input("b: ")
#🚨 Don't change the code above 👆

####################################
#Write your code below this line 👇

a,b = b,a

#Write your code above this line 👆
####################################

#🚨 Don't change the code below 👇
print("a: " + a)
print("b: " + b)


프로젝트 1 - 밴드 이름 생성기

#1. Create a greeting for your program.
print("Welcome to the Band Name Generator \n")
#2. Ask the user for the city that they grew up in.
city = input("Whats the name of the city where you grew up? \n ")
#3. Ask the user for the name of a pet.
pet_name = input("Name of pet? \n ")
#4. Combine the name of their city and pet and show them their #band name.
print("Your band name could be " + city + " " + pet_name +"")
#5. Make sure the input cursor shows on a new line, see the #example at:
#https://replit.com/@appbrewery/band-name-generator-end

좋은 웹페이지 즐겨찾기