#python-beginner
Read more stories on Hashnode
Articles with this tag
Write a Python program to count the number of occurrences of a given element in a given list. def count_occurrences(lst, element_to_count): count...
Write a Python program to find the missing number in a given array of integers. array = [1,2,3,4,5,7,8,9] n = len(array) + 1 total_sum = (n * (n + 1))...
Write a Python program to reverse a given list. n=[1,2,35,4] print(n[::-1]) Output : [4, 35, 2, 1] The expression n[::-1] is used to create a new...
Write a Python program to find the sum of all even numbers between 1 and a given number. n=int(input("enter the number")) sum=0 for i in...
Write a Python program to Check whether the given number is prime or not. n=int(input("Enter the number: ")) if n < 2 : is_prime= False else: ...
Write a Python program to check whether a given number is a prime number or not:- num = int(input("Enter a number: ")) result = "" i = 2 while i * i...