Questions: 5 831

Answers by our Experts: 5 728

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 & Filtering

Construct an algorithm and write a python to create a regular expression to

retrieve marks and names from a given string or files. Extract only marks having 2 digits

and names starting with a capital letter.


SPECIAL FACTORS


Ram loves playing with integers. He has a positive integer N. He wants to find special factors of the number. A factor is a number which exactly divides the given number. A factor is special if it is a prime number. Help ram by identifying all the special factors of the number.


INPUT : The input is a single line containing a positive integer N.


OUTPUT : The output should be a single line containing the space-separated prime factors in ascending order


EXPLANATION : In the example, the given number is 20.

the factors of 20 are 2, 4, 5, 10 Whereas the prime factors are 2, 5.


So, the output should be 2 5


sample input1 : 20


sample output1 : 2 5


sample input 2 : 45


sample output2 : 3 5


Write down a python program to calculate the total loan amount availed by each person from each bank and the total loan amount for each person irrespective of the bank using the following records.

Input

Ramesh CUB 10000 Rajesh IndianBank 20000 Ramesh CUB 20000 Arya ICICI 200000 Ramesh ICICI 20000 Rajesh KVB 30000 Vimala SBI 3000 Vimala YesBank 200000 Rajesh IndianBank 2000 Arya ICICI 2000 Vimala SBI 30000 Ramesh CUB 10000

Expected Output

Ramesh CUB 40000

Ramesh ICICI 20000

Rajesh IndianBank 22000

Rajesh KVB 30000

Arya ICICI 202000

Vimala SBI 33000

Vimala YesBank 200000

Ramesh 60000

Rajesh 52000

Arya 202000

Vimala 233000


Identify and execute the respective operations in the following expression using regular expression and functions:

(5+3)*(8+4) 

This means you have to first execute the addition operation by implementing the addition function first then execute the multiplication operation


Input: (5+3)*(8+4)

implement the following operations using python: addition, subtraction, multiplication, and division  

segregate the patterns begins and ends with parenthesis together with the operations between them: (5+3), *,(8+4)

identify the operations inside each parenthesis and extract the operands: 5,3,+and 8,4,+

call the appropriate function along with the respective arguments: add(5,3), add(8,4) and then call multiplication(8,12)


Calculate the gradient decent formula for logistic regression

X=x-a @J(x)/@(x)


Maria has 4 bags while going to the airport she has been told that she take an average 50kg . Tell her to input the weight of each bag and calculate the mean weight

SPECIAL NUMBERS


you only like numbers that start with an odd digit. anil gives you space-separated integers as input . your task is left-rotate every number in the list (if required) so that can be liked by you.


NOTE:

  1. if there is no odd digit in the number , do not rotate it.
  2. if a number starts with an odd digit , do not rotate it


INPUT :

The first line of the input contains space-separated integers


OUTPUT:

The out should be a single line containing space separated integers with odd digit as first digit for each number.


EXPLANATION:


in the example, input is 21, 503, 256, 550, 86, 979, 281

Rotate all the words to the left so that each number starts with an odd digit .


Input1: 21 503 256 550 86 979 281


Output 1: 12 503 562 550 86 979 128


Input 2: 2001 463 6219 669 473 1006 77734 110 20511


Output 2: 1200 346 1962 966 734 1006 77734 110 511120


Distinct Characters


Andy has the word W and he wants to print the unique characters in the word in the order of their occurrence.


write a program to help Andy print the unique characters as described above.


NOTE : consider lower and upper case letters as different


INPUT:

The input is a single line containing the word W


OUTPUT:


the output should be a single line containing space separated characters


EXPLANATION:


in the example, the word is MATHEMATICS


The unique characters in the given word are M, A, T, H, E, I, C, S, in the order of occurrence


so the output should be M A T H E I C S


sample input1 : MATHEMATICS


sample output1 : M A T H E I C S


sample input2 : banana

sample output 2 : b a n


Given a string write a program to print the mirror of string in Alphabetical order to create a secret message

Note Mirror means a with z , b with y and so on


I have a problem of solving to get the average of 1st quarter, 2nd quarter, 3rd quarter and 4th quarter of list and this is the code.

class Students:

  def __init__(self):

    self.studName = []

    self.gender = []

    self.stQ = []

    self.ndQ = []

    self.rdQ = []

    self.thQ = []

  def newStudent(self,newStud,studGender):

    self.studName.append(newStud)

    self.gender.append(studGender)

  def studGrades(self,first,second,third,fourth):

    self.stQ.append(first)

    self.ndQ.append(second)

    self.rdQ.append(third)

    self.thQ.append(fourth)

    print("Student Grade 1st Quarter: ", first)

    print("Student Grade 2nd Quarter: ", second)

    print("Student Grade 3rd Quarter: ", third)

    print("Student Grade 4th Quarter: ", fourth)

  #average

  def Average(self):

    for i in self.stQ,self.ndQ,self.rdQ,self.thQ:

      sums = self.stQ[i] + self.ndQ[i] + self.rdQ[i] + self.thQ[i]

      avg = sums / 4

      print(avg)