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

歡迎訪問 生活随笔!

生活随笔

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

python

python日历模块_Python日历模块| firstweekday()方法与示例

發布時間:2023/12/1 python 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python日历模块_Python日历模块| firstweekday()方法与示例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

python日歷模塊

Python calendar.firstweekday()方法 (Python calendar.firstweekday() Method)

firstweekday() method is an inbuilt method of the calendar module in Python. It works on simple text calendars and returns the current setting for the weekday to start each week.

firstweekday()方法是Python中日歷模塊的內置方法。 它適用于簡單的文本日歷,并返回每個星期開始的工作日的當前設置。

Module:

模塊:

import calendar

Syntax:

句法:

firstweekday()

Parameter(s):

參數:

  • None

    沒有

Return value:

返回值:

The function returns a number from 0 to 6 where Monday indicates 0 and so on.

該函數返回從0到6的數字,其中星期一表示0,依此類推。

Example:

例:

# Python program to illustrate the # use of firstweekday() method# importing calendar module import calendar # using setfirstweekday() function calendar.setfirstweekday(2) print(calendar.firstweekday()) print()val = calendar.setfirstweekday(calendar.FRIDAY) # sets the value to 4 which is the weekday value for FRIDAY print(calendar.firstweekday()) # prints 4 print()# Printing 3rd month of 2020 calendar.setfirstweekday(calendar.THURSDAY) print("Third month of 2020:") calendar.prmonth(2020, 3, 2, 1) # It starts displaying the calendar from THURSDAY print("The first weekday of the third month of 2020 is:", calendar.firstweekday())

Output

輸出量

24Third month of 2020:March 2020 Th Fr Sa Su Mo Tu We1 2 3 45 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 The first weekday of the third month of 2020 i s: 3

翻譯自: https://www.includehelp.com/python/calendar-firstweekday-method-with-example.aspx

python日歷模塊

總結

以上是生活随笔為你收集整理的python日历模块_Python日历模块| firstweekday()方法与示例的全部內容,希望文章能夠幫你解決所遇到的問題。

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