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 work formula measures the multiplication of magnitude of displacement (d), the component of the

orce (F), and the angle (8) between d and F. It can be obtained from the following expression:

                   W = F x d x cos(0).

  Write a program which prompts the user to enter d, F, and 0. Then, calculates W and displays

  the computed value for W on the screen. (Notice: You should include all steps and respect the

  Python syntax in order to obtain full mark).

  • Which Python built-in functions did you use to write this program?

  • Which modules in Python did you import? Which functions from the imported modules are

  applied in your program?


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).Complete the bodies of the insert, and evaluate methods. Include your solution in the sections mentioned as "Include your code here". Please do NOT change any of the code outside of these two methods.


class Node:


  def __init__(self, data):

    self.left = None

    self.right = None

    self.data = data


  def get_output(self)

    value = self.evaluate()

    if value > 999:

      print('OVERFLOW')

    elif value < 0:

      print('UNDERFLOW')

    else:

      print(value)

  # Your task is to implement the following methods. #

  def insert(self, data, bracketed):

   #Include your code here

    return self


  def evaluate(self):

    #Include your code here

    pass



Implementation of Hash Table with collision resolution techniques

in python with algorithm


Create a simple library management system following the set of requirements:


  1. Any library member should be able to search books by their title, author, subject category as well by the publication date.
  2. Each book will have a unique identification number and other details including a rack number which will help to physically locate the book.
  3. There could be more than one copy of a book, and library members should be able to check-out and reserve any copy. We will call each copy of a book, a book item.
  4. The system should be able to retrieve information like who took a particular book or what are the books checked-out by a specific library member.
  5. There should be a maximum limit (5) on how many books a member can check-out.
  6. There should be a maximum limit (10) on how many days a member can keep a book.
  7. The system should be able to collect fines for books returned after the due date.
  8. Members should be able to reserve books that are not currently available.

prefix suffix


Write a python program that input account holder Id number, account holder name, account number and account balance. A flat monthly maintenance fee of 0.5% is charge on account balance greater than or equal to 5000. The program should use a function to prompt for and input withdrawal amount, also a 2% bank fee is charge on withdrawal amount. Finally calculate the new balance by deducting the withdrawal amount and the bank fee from the balance. Output the account number, previous balance and current balance.

 



"Write an input variable for y that accepts a decimal number."

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).



*the expression stored in the binary tree is“1+(2*3)+3^ 2"*




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



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




*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 =* 100



(Should be print 100)

Instructions:

  1. Input a positive integer. This will serve as the starting point of the loop.
  2. Using a while() loop, print out all the odd numbers starting from the inputted integer, until 0. The outputted numbers must all be separated by line.
  3. Also remember that since the loop goes to descending order, a decrement variable shall be created and decreased per iteration for the loop to terminate when it reaches 0.

Instructions

  1. Create a variable and assign it to an input() function that will accept an integer greater than 0.
  2. Using a while() loop, print out all the odd numbers starting from the inputted integer, until 0. The outputted numbers must all be separated by line, just like that of the sample output.
  3. Also remember that since the loop goes to descending order, a decrement variable shall be created and decreased per iteration for the loop to terminate when it reaches 0.

Input

A line containing an integer.

10

Output

Multiple lines containing an integer.

9
7
5
3
1







The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.


Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.

Off you go!


Input

A line containing two integers separated by a space.


6·9

Output

A line containing an integer.


3
LATEST TUTORIALS
APPROVED BY CLIENTS