ex4.py

Exercise 4、5、6、7、8、9 Exercise 4、5、6、7、8、9

emmmm不用先定义变量名称,直接变量赋值一步到位。



ex5.py

Exercise 4、5、6、7、8、9Exercise 4、5、6、7、8、9

1、have variable embedded in strings : f"Hello {somevar}"。

2、如果不加f,将直接打印{stuffs}。

3、round(): 四舍五入得一个整数。

4、{}里可以做算数运算。



ex6.py

Exercise 4、5、6、7、8、9

Exercise 4、5、6、7、8、9

1、.format(var)

2、print(w + e)



ex7.py

Exercise 4、5、6、7、8、9Exercise 4、5、6、7、8、9

1、end = ' ' : 将上下两个个print连起来打印,否则下图。' '之间可以增加stuff,打印在两内容之间。

                                         Exercise 4、5、6、7、8、9

2、print("." * 10) : print 10 “.”

3、print can add strings.



ex8.py

Exercise 4、5、6、7、8、9Exercise 4、5、6、7、8、9



ex9.py

Exercise 4、5、6、7、8、9

1、三引号可以直接书写多行。主要用于注释。

2、\n换行。


相关文章:

  • 2021-10-15
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2021-08-24
相关资源
相似解决方案