top of page
Search
Rajesh Singh
Oct 29, 20241 min read
Write a program to print numbers from 1 to 20 except multiple of 2 & 3.
Program: for x in range(1,20): if(x%2==0 or x%3==0): continue print(x,end='') print("\n") Output: 1 5 7 11 13 17 19
38 views0 comments
Rajesh Singh
Feb 19, 20231 min read
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....
313 views1 comment
Rajesh Singh
Feb 19, 20231 min read
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...
856 views2 comments
Rajesh Singh
Feb 19, 20231 min read
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...
131 views0 comments
Rajesh Singh
Feb 19, 20231 min read
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...
212 views0 comments
Rajesh Singh
Feb 19, 20231 min read
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...
51 views0 comments
Rajesh Singh
Feb 18, 20231 min read
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=...
935 views0 comments
Rajesh Singh
Feb 18, 20231 min read
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:...
33 views0 comments
Rajesh Singh
Feb 18, 20231 min read
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':...
34 views0 comments
Rajesh Singh
Aug 1, 20221 min read
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...
136 views0 comments
Rajesh Singh
Feb 18, 20221 min read
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...
781 views0 comments
Rajesh Singh
Oct 12, 20211 min read
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:...
114 views0 comments
Rajesh Singh
Sep 28, 20211 min read
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...
78 views0 comments
Rajesh Singh
Sep 28, 20211 min read
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:...
590 views0 comments
Rajesh Singh
Jun 20, 20211 min read
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]...
50 views0 comments
Rajesh Singh
Jun 18, 20211 min read
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...
21 views0 comments
Rajesh Singh
Jun 17, 20211 min read
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)...
621 views0 comments
Rajesh Singh
Jun 16, 20211 min read
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]...
47 views0 comments
Rajesh Singh
Jun 16, 20211 min read
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]...
37 views0 comments
Rajesh Singh
Jun 16, 20211 min read
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...
35 views0 comments
bottom of page