In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces what is the role of commas in Python, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.
1. The use of commas in parameter passing
There is not much confusion in this case, which is the comma between parameters when parameters or arguments are passed.
For example, def abc (aformab) or abc (1mem2)
two。 The use of commas in type conversion-mainly tuple conversion
For example:
> axi11
> b = (a)
> > b
eleven
> b = (a,)
> > b
(11,)
> b = (apr 22)
> > b
(11, 22)
> b = (a, pr 22,)
> > b
(11, 22)
You can see that only when there is only one element in the b tuple, a comma is needed to convert to the tuple type.
3. The ingenious use of comma in output statement print
Example:
> for i in range (0pc5):
... Print i
...
0
one
two
three
four
> for i in range (0pc5):
... Print i
...
0 1 2 3 4
About what the role of commas in Python is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.