1、

Python Exercises(1)                                                  Python Exercises(1)

(1)The order of operations :First, do the multiplication and division from left to right; Then, do the addition and subtraction from left to right.

 

2、

Python Exercises(1)                                                          Python Exercises(1)

(1)How do I get colors in my editor?(Save our file first as a .py file, such as ex1.py. Then we'll have color when we type.)

 

3、

Python Exercises(1)                      Python Exercises(1)

(1)Why does the # in print("Hi # there.") not get ignored?(The # in that code is inside a string, so it will be put into the string until the ending " character is hit. So the # here is just considered as characters, not comments.)

 

4、

Python Exercises(1)                  Python Exercises(1)

(1)What's the difference between = and ==?(The =(single-equal) assigns the value on the right to a variable on the left.

The ==(double-equal) tests whether two things have the same value.)

(2)Can we write x=100 instead of x = 100?(Of course we can, but it's a bad form. We'd better add space around operators like this so that it's easier to read.)

 

5、

Python Exercises(1)         Python Exercises(1) (1)Can I make a variable like this: 1 = 'Zed Shaw' ?(No, 1 is not a valid variable name. They need to start with a character, so a1 would work.)

(2)How can I round a floating point number?(You can use the round() function like this: round(1.7333).)(四舍五入)

 

6、

Python Exercises(1)       Python Exercises(1)

 

相关文章:

  • 2022-01-19
  • 2022-02-08
  • 2022-02-03
  • 2022-02-23
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-12
  • 2021-11-09
  • 2021-07-29
  • 2022-12-23
  • 2021-08-13
  • 2021-10-13
  • 2021-10-17
相关资源
相似解决方案