py1_The definition of paramaters

  • Parameters

A placeholder-symbol is used to hold and represent data.
The parameters is represented by an identifier(name), and the procedure for associating an identifier is called nomination.
(In this task, “TempStr” is the name of parameter)
An equal symbol(=)can be used to assign or modify the value of parameters, =is called an assignment symbol.
(TempStr = “82F” #Means assign 82F to the parameter TempStr)* Nomination
The procedure for associating an identifier
The rules of nomination: characters and combinations of upper and lower case letters, numbers, underscores, and Chinese characters.
(e.g: TempStr, Python_Great, Das ist Python Unterricht)

Warning:
Case sensitivity(which means “P” and “p” are absolutly different parameter)
The first character cannot be a number.
Do not same as the Reserved Words(Reserve Word: An identifier which the programming language has already defined and retained for use. Programmer cannot use this words.)

  • Data type

The form of data used to be understanded by computer programmes.
Programming languages do not allow for grammatical ambiguities.
Programming languages express the form of data to the computers in a certain way.("123"means text string, and 123 means number one hundred and twenty-three)

data form:
intiger: 123
string: “123” or ‘123’
list: [123, 12, 1]

  • String

Use [] to get one or more characters in a string.
Index: return one character from string [M]
Slices: return a sub-string from string [M : N] (from Mth to N-1th)Use Reserved Word ‘in’ to determine if an element is in the string.
(TempStr[-1] in [‘C’, ‘c’] which means determine if the former is same as an element in the list)

  • Function and Assignment

if …… : (if the condition is detemined as true, then do the command behind the “:”)
The form of input: parameter = input()
The form of output: print("{: . 2f}parameter".format(parameter))
("{}"means groove, the later parameters are filled in this groove. "{: . 2f}"means two decimal places)Evaluating Function: eval()
This function removes the outermost quotation mark of the parameter and executes the remaining command.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值