murli is attending a quiz the question contains an integer n murli gas to tell the closest number to n where all the digits of that number are even in case of a tie between two numbers choose the smallest one. write a program to find the number in python coding
Ram is given a positive integer N .He wishes to convert this integer into a single numeral. He does so by repeatedly adding the numerals of the number until there is only a single numeral. Help Ram by providing the single-numeral number finally obtained.
Write a program to generate 100 random numbers between the range 1 and 1000 and search for a number through user input.
Half Interval search: is a search algorithm that finds the position of an element to be searched within a sorted array(ascendiing ordrer).It compares the search element to the midlle element of the array.If they are not equal, the half in which the search element cannot lie is eliminated and the search continues the remaning half, again taking the middle element to compare to the target value is found. If the search ends with the element is not in the array.Write a function search(ele,*args) which takes a variable number of parameters, first is an element that needs to search among the input element list and second is a list of input elements. If the element is found ,then this function returns the position of the element otherwise returns- 1.
let x and y be the numbers obtained by reversing a and b, if both x and y are prime,then the answer is x+y and if exactly one of x and y is prime, then the answer is a+b.Otherwise ,the answer is a*b.Your task is write a function F(a,b) that takes integers a and b and returns a single digit integer value.Create seperate check_prime(n) and reverse(n) for checking a given number is prime and for reversing number.function must be generalized. Use only loops,if-else or if-elif-else and sting slicing,indexing as well simple inbuilt functions.
Calculate Manhattan distances between these pairs of points (total 10*10 = 100
pairs inlcuding self pairs).This should give you a 10*10 2-D array where each value
corresponds to the distance between a pair
in a building there are n rooms numbered from 1 to n in each room there is a bulb that is initially open for the odd numbered rooms and off for the even numbered rooms before visiting a room, you will note the state of the bulb rooms before visiting a room you will note the state of the bulb when you leave a room the bulb is turned off if it is on and turned on if it numbered you then return to the station room and repeat the process for n times in python assignment
riya took part in a maths quiz competition to win the prize money she hass to solve a tricky question at the end for a given list of integers write a program where all the integers in a given index range have to be added she will be given M multiple rangs where she should print the sum of numbers for each corresponding range
New Dictionary
Peter is making a new dictionary. He wants to arrange the words in the ascending order of their length and later arrange the ones with the same length in lexicographic order. Each word is given a serial number according to its position. Find the word according to the serial number.
The serial number of words in Peter's dictionary is as follows
Word
Serial Number
A
B
1.
C
24
25
26
27
AA
AB
28
BA
a class of students p gave a science viva their final results are listed out in the order of their roll numbers in the list s the teacher asked the students to note the number of students who gave the viva after them and got less score than them write a program to get the final list from the students in the roll number order