Variable hardest Hit
I. Variables and naming conventions 1.1 What is a variable?
As the name implies, the changing amount is variable. Give a chestnut: a = 0. A is a variable, reason: After a assignment of 0, you can re-assign a = 1 a=2 a=3.etc
1.2 Inverse scales of variables:
What are the non-palpable scars of a variable? It cannot be named after numbers, letters, or underscores (the Chinese civilization has a long history, and it can support variable names, eat a pound of 0000)
Second, you can not use Python to bring the keyword name (aforetime as king, is absolutely not allowed to drip), a chestnut: for While.etc,
It is best not to use variable names that may conflict (how to bypass them), such as the function name sum (). etc
1.3 General format of variables:
For example, the value of a garment: Value_of_cloth or Valueofcloth, the words should be the following or uppercase distinction, while assigning variables to the meaning
Today's content rarely 0.0 slip over and don't miss it!
Tip: Today, share a little bit of code 0.0 can be implemented by the automatic reply Oh, although without intelligence (no spelling mistake right!!) )
ImportItchat#Import Time#reply@itchat. Msg_register (Itchat.content.PICTURE)deftext_reply (msg):Print(msg)return 'I received a%s'%Msg@itchat.msg_register (Itchat.content.TEXT)deftext_reply (msg):Print(msg)#return msg@itchat. Msg_register (Itchat.content.TEXT)deftext_reply (msg):ifMsg.text = ='Hello': Itchat.send ('Hello, excuse me, the house gas just burns up, I go back to take a picture') Else: Itchat.send (msg.text)#Robotic reply@itchat. Msg_register (Itchat.content.SHARING)deftext_reply (msg):Print(msg) itchat.auto_login (hotreload=True) Users=itchat.search_friends ("unwilling to mediocre friends wow") UserName= users[0]['UserName']Print(UserName) itchat.run ()
Big Liar python variable