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

The dew point temperature Td can be calculated (approximately)from the relative humidity RH and the actual temperature T by


Td=bf(T, RH)/a.f(T, RH)



F(T, RH) =a.T/b+T + In(RH)



where a = 17.27 and b= 237.76



write a WAP that reads the relative humidity (bio 0 and 1) and the temperature ( in degrees C) and prints the dew point value..

You are required to implement a simple symbolic equation solver. The equation must be stored in a binary tree.



Each operand or operator should be stored as a tuple of the form (TYPE, VALUE).




For example: (OPERAND, 5), (OPERAND, 7), (OPERATOR, '*’').




Following operators should be supported: addition (+), subtraction (-), multiplication (*), and exponentiation .




Skeleton of this lab is given belo. Complete the bodies of the insert, and evaluate methods. Include your solution in the sections




*Input*



root = Node(('OPERAND', 1))



root = root.insert(('OPERATOR', '+'), False)



root = root.insert(('OPERAND', 2), False)



root = root.insert(('OPERATOR', '*'), True)



root = root.insert(('OPERAND', 3), False)



root = root.insert(('OPERATOR', '+'), False)



root = root.insert(('OPERAND', 3), False)



root = root.insert(('OPERATOR', '^'), False)



root = root.insert(('OPERAND', 2), False)



root.get_output()




*Expected output* = 100

Polynomial


Given polynomial,write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1+....+C1x+C0 format.


Input


The first line contains a single Integer N.

Next N lines contain two integers Pi,Ci separated with space, where Pi denotes power and Ci denotes coefficient of Pi.


Sample Input 1

5

0 2

1 3

2 1

4 7


Sample output 1

7x^4 + 6x^3 + x^2 + 3x + 2


Sample input 2

4

0 5

1 0

2 10

3 6


Sample output 2

6x^3 + 10x^2 + 5


Don't you find it amazing to discover words and sentences that have the same first and last letter? We just don't usually notice them, so we can try it out by coding out this problem instead! Print out "Yes" if the first and last characters of the given string are the same, and "No" otherwise. It doesn't matter if they're in lowercase or uppercase, as long as it's the same letter, it fits the description.

So, what are you waiting for? Code now!


Given an integer N  denotes N×N  matrix. Initially, each cell of matrix is empty. U r given K  tasks. In each task, you are given a cell (i,j)  where cell (i,j)  represents

ith  row and jth  column of given matrix.

I/p format

  • first line contains two space-separated integers N and K where N is number of rows and columns in given matrix and K is number of tasks respectively.
  • Next K lines contain two space-separated integers i and j.

O/p format

Print K space-separated integers denoting numberr of empty cells in matrix.

Constraints

1≤N≤105

1≤K≤1000

1≤i,j≤N

Sample Input

3 3  ==>   Matrix Size is 3  and Tasks is 3.  

It should be a square matrix like 2 4 6 8...and max can be 100 x 100

Initial Matrix


Final Result

4 2 0


Initially all cells [{1, 1}, {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {3, 1}, {3, 2}, {3, 3}] are empty.

After first task:

Empty cells are [{2, 2}, {2, 3}, {3, 2}, {3, 3}]. Therefore, answer is 4.

After second task:

Empty cells are [{2, 2}, {3, 2}]. Therefore, answer is 2.

After third task:

No cells remain empty. Therefore, answer is 0.




Implement LinkedList using STL in c++. [#include <list> ,#include <iterator>]

Create two lists L1 and L2 of length 10, filling with the values of multiples of 2 and 3 respectively in L1 and L2. (hint: use push_back())

a. Show the contents of the list using iterators

b. Reverse the list L1 and display its contents (reverse())

c. Sort the list L2 and display its contents (sort())

d. Remove the element from both the sides of L1 and display its contents (pop_front() ,pop_back())

e. Add the elements to both the front and back sides of L2 and display its contents.


choose two characters a and b in the string. swap a with b if and only if the sum of ascii values a and b are odd


you know all the n friends,have all the phone numbers and can give anyone any phone number.thus, you can always add any relation you want. you have to determine the minimum number of relations to add so that all friends can reach the sick one. input:the first line contains an integer,n, denoting the number of friends python code


You are given an integer N  denoting an N×N  matrix. Initially, each cell of the matrix is empty. You are given K  tasks. In each task, you are given a cell (i,j)  where cell (i,j)  represents the 

ith  row and jth  column of the given matrix.


Given two integers (M and N), write a program to print the first perfect square in a given range.


LATEST TUTORIALS
APPROVED BY CLIENTS