0% found this document useful (0 votes)
156 views

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

The document provides 15 coding challenges to write Python programs that: 1) Accept a filename and print the extension 2) Display the first and last colors from a given list 3) Display an examination schedule by extracting the date from a given tuple 4) Compute the value of n + nn + nnn for a given integer n 5) Print documentation of built-in functions like abs() 6) Print a calendar for a given month and year using the calendar module 7) Print a multi-line string without escaping characters 8) Calculate the number of days between two given dates 9) Get the volume of a sphere with radius 6

Uploaded by

Garnik Pepelyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views

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

The document provides 15 coding challenges to write Python programs that: 1) Accept a filename and print the extension 2) Display the first and last colors from a given list 3) Display an examination schedule by extracting the date from a given tuple 4) Compute the value of n + nn + nnn for a given integer n 5) Print documentation of built-in functions like abs() 6) Print a calendar for a given month and year using the calendar module 7) Print a multi-line string without escaping characters 8) Calculate the number of days between two given dates 9) Get the volume of a sphere with radius 6

Uploaded by

Garnik Pepelyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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