Saturday, July 17, 2021

 17 July 2021

My first problem program in python

'''1. Write a Python program to print the following string in a specific format (see the output). Go to the editor
Sample String : "Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond
in the sky. Twinkle, twinkle, little star, How I wonder what you are" Output :

Twinkle, twinkle, little star,
How I wonder what you are!
Up above the world so high,
Like a diamond in the sky.
Twinkle, twinkle, little star,
How I wonder what you are '''

print("Twinkle, twinkle, little star,\n \t How I wonder what you are! \n \t \t Up above the world so high, \n \t \t "
"Like a diamond in the sky.\nTwinkle, twinkle, little star,\n\tHow I wonder what you are ")

My second program 
Write a Python program to get the Python version you are using.
import sys

print("python version")
print(sys.version)
print("Version info")
print(sys.version_info)

My THird PRogram
Write a Python program to display the current date and time.
import datetime
now = datetime.datetime.now()

print(now.strftime("%d-%m-%Y %H:%M:%S"))