Get the App
SLTechnology News&Howtos  ›  Development  › 

The concrete usage of oct function and min function in Python

Shulou Source: shulou.com Published: 2022-06-03 17:08:00 09月29日 Update

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!

Tags: Functions parameters wonderful perseverance non-accumulating steps no more than thousands of miles individuals life blogs addresses rivers and seas programs program life utf-8 accumulation programming minimum characters integers types Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Redmi Shulou Information Apple NVidia