Python program to calculate the factorial of a number

Write a Python function to calculate the factorial of a number (a non-negative integer). The function accepts the number as an argument....

top of page

Search

Rajesh Singh

- Feb 19
- 1 min

Python program to calculate the factorial of a number

Write a Python function to calculate the factorial of a number (a non-negative integer). The function accepts the number as an argument....

57 views0 comments

Rajesh Singh

- Feb 19
- 1 min

Python program accept a hyphen-separated sequence of words as input and prints the sorted words

This program is most for O Level practical Exam so read it carefully. Write a Python program that accepts a hyphen-separated sequence of...

167 views1 comment

Rajesh Singh

- Feb 19
- 1 min

NumPy program to find the most frequent value in the list.

This program is most for O Level Practical Exam so read it carefully. Program: import numpy as np x = np.array([1,2,3,4,5,7,2,1,1,1,8,9,1...

21 views0 comments

Rajesh Singh

- Feb 19
- 1 min

Python function that takes two lists and returns True if they have at least one common item.

This program is most for O Level Practical. Please read carefully. Program: def data(lst1, lst2): result = False for i in lst1: for j in...

5 views0 comments

Rajesh Singh

- Feb 19
- 1 min

Python program to compute Fibonacci series using function.

This program is one of the best for O-Level Practical. Read it carefully. Program: def fab(x): if x<2: return 1 else: return...

13 views0 comments

Rajesh Singh

- Feb 18
- 1 min

Python program to multiply two numbers by repeated addition

Program: a = int(input("Enter the first number: ")) b = int(input("Enter the second number: ")) product = 0 for i in range(b): product=...

14 views0 comments

Rajesh Singh

- Feb 18
- 1 min

Python program to find the power of a number using recursion

Program: Hello Students this program is very useful for O Level Practical so read it carefully. def power(x,y): if y==0: return 1 else:...

14 views0 comments

Rajesh Singh

- Feb 18
- 1 min

Python Program to Sort Python Dictionaries by Key or Value

Program: This program is most for practical Exam. So read carefully and understand: mydict = {'raj': 5, 'raja': 6, 'sanju': 7, 'mohan':...

17 views0 comments

Rajesh Singh

- Aug 1, 2022
- 1 min

Python Program to find largest element from the list which provided by user

Python Program to find largest element from list: list = [] num = int(input("Enter number of elements in list: ")) for i in range(1, num...

124 views0 comments

Rajesh Singh

- Feb 18, 2022
- 1 min

Python program count the number of alphabets, lowercase letters, uppercase letters, digits and words

Write a python program that takes a sentence as input and displays the number of words,number of capital letter, number of small letter...

328 views0 comments

Rajesh Singh

- Oct 12, 2021
- 1 min

Python Program to Convert Decimal to Binary using recursive function

def decitobin(n): if n > 1: decitobin(n // 2) print(n % 2,end='') num = int(input("Enter any decimal number: ")) decitobin(num) Output:...

103 views0 comments

Rajesh Singh

- Sep 28, 2021
- 1 min

Python Program to find Sum of Series 1**3 + 2**3 + ................... + n**3

Program: n = int(input("Enter Positive Number : ")) sum = 0 sum= ((n*n)*(n+1)*(n+1))/4 print("The Sum of Series is",sum) Output: Enter...

62 views0 comments

Rajesh Singh

- Sep 28, 2021
- 1 min

Python Program to Find Sum of Series 1Â²+2Â²+3Â²+â€¦.+nÂ²

The mathematical formula to find the sum of 1Â²+2Â²+3Â²+â€¦.+nÂ² is n(n+1)(2n+1)/6 So to find the sum of series we use this formula. Program:...

175 views0 comments

Rajesh Singh

- Jun 20, 2021
- 1 min

Python program to add one or more element in List

Program: #Append() is used for adding one element in List at the end of list. X=[9,18,27] X.append(36) print(X) output: [9, 18, 27, 36]...

42 views0 comments

Rajesh Singh

- Jun 18, 2021
- 1 min

Python program to remove elements of a given list

Program: n=[9,18,27,36,45,54,63] print("List=",n) i=int(input("Enter the position of elements to delete : ")) del n[i] print("List after...

17 views0 comments

Rajesh Singh

- Jun 17, 2021
- 1 min

Python program to create a list of 5 numbers

Python program to create a list of 5 numbers. Numbers entered by User. n=[] for i in range(5): j=int(input("Enter number: ")) n.append(j)...

188 views0 comments

Rajesh Singh

- Jun 16, 2021
- 1 min

Python program to find minimum value in List

Program: list=[(1,15,11), (4,7,1), (7,11,2),(10,10,18)] print("The list is: " +str(list)) res1=min(list)[0] res2=min(list)[1]...

39 views0 comments

Rajesh Singh

- Jun 16, 2021
- 1 min

Python program to find maximum value in List

Program: list=[(1,15,11), (4,7,1), (7,11,2),(10,10,18)] print("The list is: " +str(list)) res1=max(list)[0] res2=max(list)[1]...

32 views0 comments

Rajesh Singh

- Jun 16, 2021
- 1 min

Python program convert kilometers to miles

Program: n=float(input("Enter value in kilometers: ")) a=n*.621371 print("The miles of given kilometers is %.2f" %a) Output: Enter value...

25 views0 comments

Rajesh Singh

- Jun 16, 2021
- 1 min

Python program to find square root of given number

Program: n=float(input("Enter a number: ")) a=n**.5 print("The square roots of given number is ", a) Output: Enter a number: 16 The...

23 views0 comments

bottom of page