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

Artificial Mouse population satisfying the following conditions :

i. Two mouses are born one by one in 1st and 2nd months respectively. This newly born pair of mice build the initial population.

ii. These mice can mate at the age of 2nd month such that this mice pair brings another pair of mice in the 3rd month. So, in this way the mouses produced in a particular month will be equal to sum of mouses produced in the previous 2 months.

iii. If the a and b are produced in the 1st and 2nd months to form an initial population there will be a + b mouses in the 3rd month.

iv. These mice are immortal. They will not die.


Write a python function population-series(a, b, n) which takes the population as a ,b and a

positive integer number 'n' as number of months and returns no. of mouses produced in each month till the nth month in string format using recursion.


Write a python function Sum(x) which takes a comma-separated string of numbers and returns the reverse of the sum of the smallest and largest numbers in the given list as shown in example. For ex , for the list 10,28,43,52 the sum of smallest and largest numbers is 62 and the reverse is 26. Write a separate recursive function Reverse-Sum(n)

to compute the reverse of a number and call this function inside the Sum(x). Do not use

input() function, specify the input in fixed form.


given weekday of the first day of the month, determine the day of the week of the given date in that month.

input: 1st line is a string-D

2nd line is a integer-N


write a program to print W pattern of n lines using an asterisk charecter (*)

Given a weighted undirected tree of N nodes and Q queries. Each query contains an integer D. For each query, find the number of paths in the given tree such that all the edges in the path




are divisible by D.




put Format:




First line contains two space separated integers, N and Q (1 ≤ N.Q < 10³), denoting number of nodes in the tree and number of queries. Next N 1 ine contains three space separated integer Y and W[1 < X,Y <N] (1< W< 10³), denoting that there is an edge between X and Y of weight W. Next Qlines contains one integer each, 0(1 <D≤ 10').

"""Q5: 

Create a Pivot Table that shows the median rating for each director, grouped by their respective countries. Name your variable

'pivot_agg'

"""


AssertionError: DataFrame are different

DataFrame shape mismatch
[left]:  (19, 117)
[right]: (125, 1)





b.

c. d.


1 2 3 4 5 6 7 8 9 10 11

Fill the array with random numbers between 10 and 90 Calculate and print out the sum of the elements in such manner:

- If the element is even divided by 2

- If the element is odd multiply it with 2

Display the array elements in reverse order 4 numbers on each line Create another array B of 12 integer numbers

Then copy the elements of A to B in such manner:

Write the odd numbers first then the even ones

A

 13

  25

  75

  35

  79

  50

  60

  90

  80

  40

  10

  90


An integer number is said to be a perfect number if its factors, including 1 (but not the number itself), sum to the number. For example, 6 is a perfect number, because 6 = 1 + 2 + 3. Write a method perfect that determines whether parameter number is a perfect number. Use this method in an application that determines and displays all the perfect numbers between 1 and 1000. Display the factors of each perfect number to confirm that the number is indeed perfect.


Write a method multiple() that determines, for a pair of integers, whether the second integer is a multiple of the first. The method should take two integer arguments and return true if the second is a multiple of the first and false otherwise. [Hint: Use the remainder operator “Modulo”.] Incorporate this method into an application main() that inputs a series of pairs of integers (one pair at a time) and determines whether the second value in each pair is a multiple of the first.


A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time.

Write an application that calculates and displays the parking charges for each customer who parked in the garage yesterday. You should enter the hours parked for each customer.

The program should display the charge for the current customer and should calculate and display the running total of yesterday’s receipts. The program should use the method calculateCharges() to determine the charge for each customer.


LATEST TUTORIALS
APPROVED BY CLIENTS