Professional Documents
Culture Documents
Practice Programs
Practice Programs
Practice Programs
Solution:
In [ ]:
Question 2: A leap year is exactly divisible by 4 except for century years (years ending with 00).
The century year is a leap year only if it is perfectly divisible by 400. For example,
Solution:
In [ ]:
Question 3: A positive integer greater than 1 which has no other factors except 1 and the
number itself is called a prime number. 2, 3, 5, 7 etc. are prime numbers as they do not have any
other factors. But 6 is not prime (it is composite) since, 2 x 3 = 6 . Write a Python Program to
Check Prime Number.
Solution:
In [ ]:
Solution:
In [ ]:
Solution:
In [ ]:
Solution:
In [ ]:
Question 7: Write a program to find the sum of digits of a number using the for loop.
Solution
In [ ]:
Question 8 Write a Python program that takes a specified number of integers as input, stores
them in a list, and then calculates the arithmetic mean (average) of the given numbers.
Solution
In [ ]:
Question 9 Write a Python program that takes a specified number of integers as input, stores
them in a list, and then calculates the median of the given numbers.
Solution
In [ ]:
Question 10 Write a Python program that takes a specified number of integers as input, stores
them in a list, and then calculates the variance of the given numbers.
Solution
In [ ]:
Question 11: Write a Python program that prompts the user to enter a series of cash flows,
adds them into a list, and then calculates the present values and the Net Present Value (NPV) of
the cash flows.
Solution
In [ ]:
Question 12: Basic Statistical analysis we will create a program in which user will have to input
some numbers, once the input is complete, the user has to enter "e". the program will
Solution
In [ ]: