Python Answers

Questions answered by Experts: 5 288

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

First Perfect Square Given two integers (M and N), write a program to print the first perfect square in a given range.Input The first line of input will contain a positive integer (M). The second line of input will contain a positive integer (N).Output The output should be a single line containing the first perfect square in a given range.Explanation For example, if the given numbers are M is 4 and N is 16, the perfect squares from 4 to 16 are 4(2 * 2), 9(3 * 3), and 16(4 * 4), as the first perfect square is 4. So the output should be 4. Sample Input 1 4 16 Sample Output 1 4 Sample Input 2 5 8 Sample Output 2 No Perfect Square
Add two polynomials Given two polynomials A and B, write a program that adds the given two polynomials A and B.Input The first line contains a single integer M. Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A. After that next line contains a single integer N. Next N lines contain two integers Pj, Cj separated with space, where Pj denotes power and Cj denotes co-efficient of Pj for polynomial B. Input 1 4 0 5 1 0 2 10 3 6 3 0 1 1 2 2 4 output 1 6x^3 + 14x^2 + 2x + 6 input 2 4 0 5 1 0 2 10 3 6 4 0 -5 1 0 2 -10 3 -6 output2

 38. How do you check if a string contains a subsequence? - Link 

Example: Str-1 = “XAY”, Str-2= “XYAXAYZAX” string 1 is present in a substring of string 2 i.e XAY is present in XYAXAYZAX


  36. write a function to add any number of numbers for Eg. add(1,2)

add(1,2,3)

add(1,2,3,4,5)


 34. can you please take out the half name of your full name by index method

 


33. Write a program, how to check if the input is in the given list or not ..?

  


program to Get max. consecutive sum of 2 numbers in a list?


 31. Print merge two lists one is integer another is float


28.Take a list with 6 different characters and print the 2nd and 3rd character?

 


 26. difference between Break and Continue statements with an example python program?

 


LATEST TUTORIALS
APPROVED BY CLIENTS