In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you the sample analysis of variables and data types in python, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Variables and data types
Assignment does not need to specify a type, how to define variables
# define rule variable name = data adept 10 # python does not declare data types, so values must be assigned when defining variables
Av10 # python does not declare data types, so you must assign a value to a=20print (a) # use a to define the variable before it can be used, the variable can be changed # the value can be changed during program execution
The value can be changed directly without definition.
Enter the python terminal directly from pycharm
Realize numerical access through variables
Output element type
Print (type (a))
# Advanced type b = () # meta-ancestor type print (type (b)) c = [] # # list type print (type (c)) d = {} # # dictionary type print (type (d))
Naming rules for variables in Python
Name='liudehua' # cannot start with a number print (Name) _ age=89print (_ age)
Name='qianiqan' # case-sensitive print (name) # color changes can be considered that the keyword cannot be the variable name True=10print (True)
Naming convention
The above is all the content of the article "sample Analysis of variables and data types in python". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.