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

a program

The document outlines a series of programming tasks for users to implement, including calculating the area and volume of a sphere, finding the factorial of a number, checking for palindrome and prime numbers, and displaying various patterns. Additional tasks involve string statistics, locating characters in strings, removing elements from lists, and working with list slices to compute sums and averages. The final task requires combining two lists to find the maximum element and its index.

Uploaded by

nafiafaroo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

a program

The document outlines a series of programming tasks for users to implement, including calculating the area and volume of a sphere, finding the factorial of a number, checking for palindrome and prime numbers, and displaying various patterns. Additional tasks involve string statistics, locating characters in strings, removing elements from lists, and working with list slices to compute sums and averages. The final task requires combining two lists to find the maximum element and its index.

Uploaded by

nafiafaroo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Write a program to accept the radius of a sphere from the user and display its

Area and volume. Area=πr2 and Volume=4πr3

2. Write a program to accept a number from the user and display its factorial.

3. Write a program to accept a number from the user and display whether it is a Palindrome
number or not.

4. Write a program to accept a number from the user and display whether it is a prime number
or not.
5. Write a program to display the following pattern :
1
12
123

1234

12345

6. Write a program to display the following pattern :


1

23

456
7 8 9 10
11 12 13 14 15

7. Write a program that reads a string and print its statistics like : Number of Uppercase letters,
Number of lowercase letters, Number of alphabets, Number of digits, Number of symbols.
8. Write a program that asks the user for a string s and character c and then it Prints the
location of the character c in the string s.
9. Write a program to input a list and an element, and remove all occurrences of the Given
element from the list.
10. Extract two list slices out of the given list of numbers. Display and print the Sum of elements
of list slice which contains every other element of the list Between indexes 5 to 15. Program
should display the average of elements in Second list slice that contains every fourth
element of the given list. The list Contains numbers 1 to 20.
11. Write a program to input two lists and display the maximum element from the Elements of
both the list combined, along with the index in its list.

You might also like