print("Hello,world!")

if 5>2:
 print("5大于2")

 #这是一个注释
 """这也是一个注释"""

x = 5
y = "Hello, World!"
print(x)
print(y)

x = 5 # x is of type int
x = "Steve" # x is now of type str
print(x)

x = "Bill"
# is the same as
x = 'Bill'
print(x)

x, y, z = "Orange", "Banana", "Cherry"
print(x)
print(y)
print(z)

x = "awesome"
print("Python is " + x)

x = "Python is "
y = "awesome"
z =  x + y
print(z)

x = 5
y = 10
print(x + y)

#如果您尝试组合字符串和数字,Python 会给出错误
x = 10
y = "Bill"
print(x + y)

结果:

【Python】小练习

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2021-08-27
  • 2021-06-03
  • 2022-03-02
  • 2022-12-23
猜你喜欢
  • 2021-04-02
  • 2021-11-23
  • 2022-12-23
  • 2021-12-12
  • 2022-02-27
相关资源
相似解决方案