Go To The Editor: Sample Filename: Abc - Java Output: Java

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

7.

 Write a Python program to accept a filename from the user


and print the extension of that. Go to the editor
Sample filename : abc.java
Output : java
Click me to see the sample solution

8. Write a Python program to display the first and last colors


from the following list. Go to the editor
color_list = ["Red","Green","White" ,"Black"]
Click me to see the sample solution

9. Write a Python program to display the examination


schedule. (extract the date from exam_st_date). Go to the
editor
exam_st_date = (11, 12, 2014)
Sample Output : The examination will start from : 11 / 12 /
2014
Click me to see the sample solution

10. Write a Python program that accepts an integer (n) and


computes the value of n+nn+nnn. Go to the editor
Sample value of n is 5
Expected Result : 615
Click me to see the sample solution

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.
Click me to see the sample solution

12. Write a Python program to print the calendar of a given


month and year.
Note : Use 'calendar' module.
Click me to see the sample solution

13. Write a Python program to print the following here


document. Go to the editor
Sample string :
a string that you "don't" have to escape
This
is a ....... multi-line
heredoc string --------> example
Click me to see the sample solution

14. Write a Python program to calculate number of days


between two dates.
Sample dates : (2014, 7, 2), (2014, 7, 11)
Expected output : 9 days
Click me to see the sample solution

15. Write a Python program to get the volume of a sphere with


radius 6.
Click me to see the sample solution

You might also like