“Cómo llegar hoy a la semana en Python” Código de respuesta

Obtenga la semana actual Python

import datetime
my_date = datetime.date.today() # if date is 01/01/2018
year, week_num, day_of_week = my_date.isocalendar()
print("Week #" + str(week_num) + " of year " + str(year))
Clear Capybara

Cómo llegar hoy a la semana en Python

today_day = date.today()
days = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","sunday"]
print("Today weekday is ",days[today_day.weekday()])
Programmer of empires

Python DateTime obtenga el nombre de la semana

import datetime
now = datetime.datetime.now()
print(now.strftime("%A"))
Beautiful Beaver

Respuestas similares a “Cómo llegar hoy a la semana en Python”

Preguntas similares a “Cómo llegar hoy a la semana en Python”

Más respuestas relacionadas con “Cómo llegar hoy a la semana en Python” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código