In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "the specific usage of oct function and min function in Python". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the specific usage of oct function and min function in Python".
I. brief introduction of Python oct function
The oct function converts an integer to an octal string with the following syntax:
Parameter: X-integer; return value: octal data corresponding to the integer '' oct (x) II. Python oct function uses #! usr/bin/env python#-*-coding:utf-8 _ *-"@ Author: ape programming @ Blog (personal blog address): www.codersrc.com@File:Python oct function .py @ Time:2021/05/10 07:37@Motto: do not accumulate steps to reach thousands of miles, do not accumulate small streams, there is no way to become rivers and seas, the splendor of program life needs to be accumulated unremittingly!" > oct (10) '012' > oct (20) '024' > oct (15) '017' > 1.Python chr function converts the ascll code to the character #! usr/bin/env python#-*-coding:utf-8 _ *-"@ Author: ape programming @ Blog (personal blog address): www.codersrc.com@File:Python oct function .py @ Time:2021/05/10 07:37@Motto: no accumulation of steps, no accumulation of small streams, no success. Program the splendor of life needs to be accumulated unremittingly! Chr (65) > "A" 2.Python ord function converts characters into ascll code #! usr/bin/env python#-*-coding:utf-8 _ *-"@ Author: ape programming @ Blog (personal blog address): www.codersrc.com@File:Python oct function .py @ Time:2021/05/10 07:37@Motto: do not accumulate steps to reach thousands of miles, do not accumulate small streams to become rivers and seas, the splendor of program life needs to be accumulated unremittingly!" Ord ("A") > 65 III. Introduction to Python min function
The min function returns the minimum value of a given parameter, which can be a sequence syntax:
# return value: return the minimum value in the parameters; min (x, y, z,.... ) four. Python min function uses #! usr/bin/env python#-*-coding:utf-8 _ *-"@ Author: ape said programming @ Blog (personal blog address): www.codersrc.com@File:Python min function .py @ Time:2021/05/09 08:00@Motto: do not accumulate long steps, do not accumulate small streams, there is no way to become rivers and seas, the wonderful life of the program needs to be accumulated unremittingly!" # max supports two or more parameters and returns a minimum value of print (min (1Magne5)) print (min (5.5pint 6100mem1mae 10je 20))
Output result:
one
-10
''
Note: the type in the min function can only be int or float, and other types will report an error, for example:
Print (min (1 not supported between instances of') TypeError:'> 'not supported between instances of' str' and 'int' thank you for your reading. The above is the content of "specific usage of oct function and min function in Python". After the study of this article, I believe you have a deeper understanding of the specific usage of oct function and min function in Python, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.