KEMBAR78
Python Programs | PDF
0% found this document useful (0 votes)
10 views1 page

Python Programs

The document outlines four Python programming tasks: calculating library fines based on late book returns, raising one number to the power of another, displaying string characters by index, and accessing string characters in both forward and backward directions using loops and slicing. Each task requires user input and specific output formatting. The tasks emphasize basic programming concepts such as conditionals, loops, and string manipulation.

Uploaded by

adoranto737
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)
10 views1 page

Python Programs

The document outlines four Python programming tasks: calculating library fines based on late book returns, raising one number to the power of another, displaying string characters by index, and accessing string characters in both forward and backward directions using loops and slicing. Each task requires user input and specific output formatting. The tasks emphasize basic programming concepts such as conditionals, loops, and string manipulation.

Uploaded by

adoranto737
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/ 1

1. A library charges a fine for every book returned late.

For first five days


the fine is 50 paise, for 6 to 10 days fine is one rupee, and above 10 days
fine is five rupees. If you return the book after 30 days your membership
will be cancelled. Write a Python program to accept the number of days
the member is late to return the book and display the fine or the
appropriate message.

2. Two numbers are entered through keyboard, Write a Python program to


find the value of one number raised to the power another.

3. Write a program to accept some string from the keyboard and display its
characters by index-wise (both positive and negative index).

4. Write a Python program to access each character of string in forward and


backward direction by using the while loop and slice operators.

You might also like