Posts

Showing posts with the label python programm

write a python script to convert a number into str type

  #write a python script to convert a number into str type a= 5 print(str(a))

Write a python script to display the current date and time. First create variables to store date and time, then display date and time in proper format (like: 13-8-2022 and 9:00 PM """

  """ Write a python script to display the current date and time. First create variables to store date and time, then display date and time in proper format (like: 13-8-2022 and 9:00 PM """ from datetime import datetime dt=datetime.today() d1=dt.strftime( "%d-%m-%y and %I-%m-%p" ) print(d1)