Python study notes Day 1 Operators and Variables

Python study note Day 1
After the ‘print’ statement, I gonna study the operators and variables.
There are some operators when we use Python to write a project.
Like
+
-
*
**
/
//
%
and so on.
OPERATORS
Screen Shot 1
Screen Shot 2
In these two pictures, we can see it clearly that the different operators has different ways to use. By the way, the operator ‘%’ means remainder after division and the operator ‘/’ means division and the quotient is a floating point number.
And, opposite the operator ‘%’ means MOD, the operator ‘//’ means INT

VARIABLES

Here’s a new concept we need to study named variable.
It can be seemed as a container contains the int,float,string and something else.
And the variable even can be expressed as a formula consisting of variables.
I will show some examples about different kinds of the methods to use the variable to output some message.
Screen Shot 3
The double quotation marks in the use of the ‘print’ statement indicate the output of the string.
Obviously, in this screen shot, there are different results whether to use double quotation marks.
Screen Shot 4
In this picture, I’ve shown another method to use the variable.
The variable can be used to be expressed as a formula consisting of other variables. And the difference between these two ways to output is the problem about whether to change to a newline.
Screen Shot 5
Maybe there are some floating point numbers and some strings of the codes need to be output, we can set a variable to represent these things.
At the end of the picture, we can see it clearly that what the double quotation marks ways to use.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值