日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

Python oct 函数 - Python零基础入门教程

發(fā)布時間:2024/9/27 python 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Python oct 函数 - Python零基础入门教程 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

目錄

  • 一.Python oct 函數(shù)簡介
  • 二.Python oct 函數(shù)使用
    • 1.Python chr 函數(shù)將 ascll 碼轉為字符
    • 2.Python ord 函數(shù)將字符轉為 ascll 碼
  • 三.猜你喜歡

基礎 Python 學習路線推薦 : Python 學習目錄 >> Python 基礎入門

oct 函數(shù)也是 Python 內置函數(shù),主要將一個整數(shù)轉為八進制,與 ord 函數(shù) / chr 函數(shù) 有點類似;

一.Python oct 函數(shù)簡介

oct 函數(shù)將一個整數(shù)轉換成 8 進制字符串,語法如下:

''' 參數(shù):x – 整數(shù);返回值:返回整數(shù)對應的八進制數(shù)據(jù); ''' oct(x)

二.Python oct 函數(shù)使用

# !usr/bin/env python # -*- coding:utf-8 _*- """ @Author:猿說編程 @Blog(個人博客地址): www.codersrc.com @File:Python oct 函數(shù).py @Time:2021/05/10 07:37 @Motto:不積跬步無以至千里,不積小流無以成江海,程序人生的精彩需要堅持不懈地積累!""">>>oct(10) '012' >>> oct(20) '024' >>> oct(15) '017' >>>

1.Python chr 函數(shù)將 ascll 碼轉為字符

# !usr/bin/env python # -*- coding:utf-8 _*- """ @Author:猿說編程 @Blog(個人博客地址): www.codersrc.com @File:Python oct 函數(shù).py @Time:2021/05/10 07:37 @Motto:不積跬步無以至千里,不積小流無以成江海,程序人生的精彩需要堅持不懈地積累!"""chr(65) >>>> "A"

2.Python ord 函數(shù)將字符轉為 ascll 碼

# !usr/bin/env python # -*- coding:utf-8 _*- """ @Author:猿說編程 @Blog(個人博客地址): www.codersrc.com @File:Python oct 函數(shù).py @Time:2021/05/10 07:37 @Motto:不積跬步無以至千里,不積小流無以成江海,程序人生的精彩需要堅持不懈地積累!"""ord("A") >>>> 65

三.猜你喜歡

  • Python 條件推導式
  • Python 列表推導式
  • Python 字典推導式
  • Python 不定長參數(shù) *argc/**kargcs
  • Python 匿名函數(shù) lambda
  • Python return 邏輯判斷表達式
  • Python is 和 == 區(qū)別
  • Python 可變數(shù)據(jù)類型和不可變數(shù)據(jù)類型
  • Python 淺拷貝和深拷貝
  • Python 異常處理
  • Python 線程創(chuàng)建和傳參
  • Python 線程互斥鎖 Lock
  • Python 線程時間 Event
  • Python 線程條件變量 Condition
  • Python 線程定時器 Timer
  • Python 線程信號量 Semaphore
  • Python 線程障礙對象 Barrier
  • Python 線程隊列 Queue – FIFO
  • Python 線程隊列 LifoQueue – LIFO
  • Python 線程優(yōu)先隊列 PriorityQueue
  • Python 線程池 ThreadPoolExecutor(一)
  • Python 線程池 ThreadPoolExecutor(二)
  • Python 進程 Process 模塊
  • Python 進程 Process 與線程 threading 區(qū)別
  • Python 進程間通信 Queue / Pipe
  • Python 進程池 multiprocessing.Pool
  • Python GIL 鎖
  • 未經允許不得轉載:猿說編程 ? Python oct 函數(shù)

    總結

    以上是生活随笔為你收集整理的Python oct 函数 - Python零基础入门教程的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。