Write a program that keeps on accepting a number from the user until the user enters Zero. Display the sum and average of all the numbers. ''' Write a program that keeps on accepting a number from the user until the user enters Zero. D…
The natural logarithm can be approximated by the following series The natural logarithm can be approximated by the following series. If x is input through the keyboard, write a program to calculate the sum of the first seven terms of this series. &…
Write a Python Program to Find the Sum of the Series till the nth term Part 2 Write a Python Program to Find the Sum of the Series till the nth term: 1 + x^2/2 + x^3/3 + … x^n/n n will be provided by the user ''' Write a Python Program …
Write a program to calculate the sum of the following series till the nth term Write a program to calculate the sum of the following series till the nth term 1/1! + 2/2! + 3/3! + 4/4! +…….+ n/n! n will be provided by the user ''' Wri…
Assume a list with numbers from 1 to 10 and then convert it into a dictionary where the key would be the numbers of the list and the values would be the square of those numbers ''' Assume a list with numbers from 1 to 10 and then conv…
Write a program to merge two given dictionary ''' Write a program to merge two given dictionary ''' dict1 = { "a" : 1 , "b" : 2 , "c" : 3 } dict2 = { "d" : 4 , "e" : 5 , …
Write a program to swap the key value pair for max and min values ''' Write a program to swap the key value pair for max and min values Eg if the dict is like this {‘a’:1,’b’:2,’c’:3} Output should be {a:3,b:2,c:1} ''' …
Write a program to find histogram of a given set of numbers. Take bin size from user. Print the result in the form of a dictionary. ''' Write a program to find histogram of a given set of numbers. Take bin size from user. Print the res…
Write a function that accepts a string and returns the number of upper case chars and lower case chars as a dictionary ''' Write a function that accepts a string and returns the number of upper case chars and lower case chars as a dict…
Write a function that accepts a list of strings and performs Bag of words and convert it to numerical vectors ''' Write a function that accepts a list of strings and performs Bag of words and convert it to numerical vectors. https://e…
Write a dummy program that can perform login and registration using a menu driven program ''' Write a dummy program that can perform login and registration using a menu driven program ''' # Initialize a dictionary to sto…
Write a program that accepts neighbors(set of 2D co-ordinates) and a point(single 2D co-ordinate) and tells nearest neighbor(in terms of euclidean distance) ''' Write a program that accepts neighbors(set of 2D co-ordinates) and a point…
Write a function that accepts a number and returns it’s factorial. You can not use any loop ''' Write a function that accepts a number and returns it’s factorial. You can not use any loop ''' def factorial(n): if …
Write a program to print the first 25 odd numbers ''' Write a program to print the first 25 odd numbers ''' counter = 0 num = 1 while counter < 25 : print (num) num += 2 counter += 1
Write a program to print whether a given number is prime number or not ''' Write a program to print whether a given number is prime number or not ''' def is_prime(n): if n<= 1 : return False elif n&…
Print all the armstrong numbers in the range of 100 to 1000 ''' Print all the armstrong numbers in the range of 100 to 1000 ''' for num in range( 100 , 1001 ): order = len(str(num)) sum = 0 temp = num …
The current population of a town is 10000. The population of the town is increasing at the rate of 10% per year. You have to write a program to find out the population at the end of each of the last 10 years. For eg current population is 10000 so the …
Write a program that will swap numbers ''' Write a program that will swap numbers ''' n1 = input( "Enter the first number: " ) n2 = input( "Enter the second number: " ) print (f "Before swappin…
Write a program that will tell the number of dogs and chicken are there when the user will provide the value of total heads and legs. ''' Write a program that will tell the number of dogs and chicken are there when the user will provi…
Write a program that will give you the in hand salary after deduction of HRA(10%),DA(5%),PF(3%), and tax(if salary is between 5-10 lakh–10%),(11-20lakh–20%),(20< _ – 30%)(0-1lakh print k) ''' Write a program that will give you the …