Sample String: "Twinkle, Twinkle, Little Star, How I Wonder What You Are! Up Above The
Sample String: "Twinkle, Twinkle, Little Star, How I Wonder What You Are! Up Above The
Write a Python program to print the following string in a specific format (see the
output).
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
2. Write a Python program to get the Python version you are using.
4. Write a Python program which accepts the radius of a circle from the user and
compute the area.
Sample Output :
r = 1.1
Area = 3.8013271108436504
5. Write a Python program which accepts the user's first and last name and print them in
reverse order with a space between them.
7. Write a Python program to accept a filename from the user and print the extension of
that.
Sample filename : abc.java
Output : java
8. Write a Python program to display the first and last colors from the following list.
color_list = ["Red","Green","White" ,"Black"]
9. Write a Python program to display the examination schedule. (extract the date from
exam_st_date).
exam_st_date = (11, 12, 2014)
Sample Output : The examination will start from : 11 / 12 / 2014
10. Write a Python program that accepts an integer (n) and computes the value of
n+nn+nnn.
Sample value of n is 5
Expected Result : 615
11. Write a Python program to print the documents (syntax, description etc.) of Python
built-in function(s).
Sample function : abs()
Expected Result :
abs(number) -> number
Return the absolute value of the argument.
12. Write a Python program to print the calendar of a given month and year.
Note : Use 'calendar' module.
17. Write a Python program to test whether a number is within 100 of 1000 or 2000.
18. Write a Python program to calculate the sum of three given numbers, if the values
are equal then return three times of their sum.
19. Write a Python program to get a new string from a given string where "Is" has been
added to the front. If the given string already begins with "Is" then return the string
unchanged.
21. Write a Python program to find whether a given number (accept from the user) is
even or odd, print out an appropriate message to the user.
23. Write a Python program to get the n (non-negative integer) copies of the first 2
characters of a given string. Return the n copies of the whole string if the length is less
than 2.