Udemy - 100 Days of Code: The Complete Python Pro Bootcamp
Day 1 - Beginner - Working with Variables in Python to Manage Data
6. Print Function
print("Hello world!")
7. String Manipulation
# Newline Escape Sequence 换行转义序列
print("Hello world!\nHello world!")
# String Concatenation 字符串拼接
print("Hello" + " " + "Angela")
8. Input Function
input("What is your name?")
9. Variables
username = input("what is your name?")
length = len(username)
print(length)
10. Variable Naming
# 1. Variable names must start with a letter or the underscore character
# 2. Variable names cannot start with a number
# 3. Variable names can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
# 4. Variable names are case-sensitive
# 5. Variable names cannot be any of the Python keywords
11. Band Name Generator Project
print("Welcome to the Band Name Generator.")
city = input("which city did you grow up in?\n")
pet = input("what is the name of a pet?\n")
print("Your band name could be: " + city + " " + pet)
818

被折叠的 条评论
为什么被折叠?



