diff --git a/program no 1.py b/program no 1.py new file mode 100644 index 0000000..d55a3a6 --- /dev/null +++ b/program no 1.py @@ -0,0 +1,3 @@ +# Program no 1 + +print "Twinkle, twinkle, little star,\n\tHow I wonder what you are,\n\t\tUp above the world so high!\n\t\tLike a diamond in the sky.\nHow I wonder what you are,\n\tUp above the world so high" \ No newline at end of file diff --git a/program2.py b/program2.py new file mode 100644 index 0000000..63c7db9 --- /dev/null +++ b/program2.py @@ -0,0 +1,7 @@ +# Program no 2 + +import sys +print("Python version") +print (sys.version) +print("Version info.") +print (sys.version_info) \ No newline at end of file diff --git a/program3.py b/program3.py new file mode 100644 index 0000000..b40025f --- /dev/null +++ b/program3.py @@ -0,0 +1,9 @@ +# Program no 3 + +from datetime import datetime +# datetime object containing current date and time +now = datetime.now() + + +dt_string = now.strftime("%d/%m/%Y %H:%M:%S") +print("date and time =", dt_string) \ No newline at end of file diff --git a/program4.py b/program4.py new file mode 100644 index 0000000..9d4c1ba --- /dev/null +++ b/program4.py @@ -0,0 +1,6 @@ +# Program no 4 + +from math import pi + +radius = float(input ("Input the radius of the circle : ")) +print ("The area of the circle with radius " + str(radius) + " is: " + str(pi * radius**2)) \ No newline at end of file diff --git a/program5.py b/program5.py new file mode 100644 index 0000000..bb809b9 --- /dev/null +++ b/program5.py @@ -0,0 +1,7 @@ +# Program no 5 + +1stname = input(" Enter 1st name ") +lastname = input(" Enter last name ") + +print 1stname[::-1] +print lastname[::-1] \ No newline at end of file diff --git a/program6.py b/program6.py new file mode 100644 index 0000000..1ac35c0 --- /dev/null +++ b/program6.py @@ -0,0 +1,6 @@ +# Program no 6 + +num1 = input(" Enter 1st num ") +num2 = input(" Enter second num ") + +print ("The addition of num1 and num2 is : "num1+num2) \ No newline at end of file diff --git a/py assigment 1.PNG b/py assigment 1.PNG new file mode 100644 index 0000000..f32c5c4 Binary files /dev/null and b/py assigment 1.PNG differ