Example HTML page

P-Assignment 6

Hi,

Please do the following programs.

  1. write a python script to search the element is present in the list or not.  Assume the list contains [10,20,30,40,50,60,70], if the user enters 40, it has to print the element is found and it should terminate. if the element is not found it should print the element is not found.
  2. Write a python script to find the largest element in the given list using for loop. for example if the list contains [1,2,56,74,0,3,44] , it should print the output value as 74.
  3. Write a python script to find the smallest element in the given list using for loop. for example if the list contains [1,2,56,74,0,3,44] , it should print the output value as 0.
  4. Write a python script to find the sum of smallest and largest element in the list. for example if the list contains [1,2,56,74,0,3,44], it should print the sum as 74. i.e. (74+0)
  5. Write a python script to find the average of smallest and largest element in the list. for example if the list contains [1,2,56,74,0,3,44], it should print the average as 37.
  6. Write a python script to print the largest number in the list is an even number or odd number.  for example if the list contains [1,2,56,74,0,3,44] the maximum element is 74, it should print it is even.
  7. Write a python script to print the number of students who got marks more than 90 in one subject. assume the list of marks of the students in one subject are [99,80,91,78,65,23,16,93]. you program should print the count is 3.
  8. Write a python script to print the Fibonacci series of up to the maximum element in the given list. For example, if the list contains [1,2,56,74,0,3,44], it should print the Fibonacci series up to 74.  Note: use while loop for finding the maximum value, and for loop for printing Fibonacci series.
  9. Write a python script to print the given number in the list contains duplicates or not. For example if the list contains the [10,20,30,40,50,30]. if user has given the search element 30, then it should print the ’30 has duplicates’. if the user has enter 75, then it should print “no element found in the list”.
  10. write a python script to print the sum of elements in the list -if it contains the only the positive elements. If the list contains any negative element it should print “negative element found” and terminate the program.
  11. write a python script to print the sum of  positive elements in the list. If the list contains any negative element skip that element. for example, if the list contains [10,-10,20,30], then output should be 60. (10+20+30) i.e. -10 is skipped.
  12. Write a python script to print all the prime numbers with in a given range.
  13. Write a python script to find the H.C.F of the two given input numbers.
Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest