Python 100 Days of Code - Day1
Ms摩卡蛋卷
2022年12月14日 21:39
收录于文集
共3篇

学习笔记

## Day 1 Variables & Functions

- print() --to print out

- input()

代码块
Python
自动换行
复制代码
print('Hello ' + input('what is your name? ') + '!')
复制成功

- len() --the length of the string

代码块
Python
自动换行
复制代码
# 1.3 return the length of the input:name
print(len(input('Waht is your name?' )))
复制成功

- \n --new line

exchange the value of two variables


Project: Band Name Generator

代码块
Python
自动换行
复制代码
# day1 project 'band name generator'
print('Welcome to the band name generator.')
city = input('What is the city you grew up in?\n')
pet_name = input('What is the name of your pet?\n')
print(f'Your band name is: {city} {pet_name}')
复制成功

Replit @Cici-Han


课程名字:100 Days of Code: The Complete Python Pro Bootcamp for 2023 | Udemy