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

For a in range (2,5): print (a+(a-1)

there are multiple (T) bookstores in the area. Each shopkeeper has a list of B integers that represent the cost of each book.You have different pocket money P for each bookstore. Write a program to calculate the maximum number of books you can buy in each bookstore with the corresponding pocket money


Aleena’s sister who studies in UK coming to Pakistan over winter break. She wants to make a

program that easily calculates the difference between the time of arrival and departure of her

flight.

Write a program that takes in an input from the user for the time of arrival and time of departure

in military format. Using an if/else statement, find the difference in number of hours and minutes

between the two times. Keep in mind that the time of departure is later than the time of arrival

otherwise the program should give an error, “Incorrect Input”.


Zoya parents run a small bakery. They currently do billing manually. Zona decides to help




them by writing a small python program that takes as input the number of each item bought and




prints the total bill amount and change due.




You can create your own 5 items that are sold at the bakery and the price per unit of each item




(get creative!).




The program would ask for the number of each item that the customer is buying, assume that




they will enter 0 for items that the customer is not buying, and print the total amount. Then ask




for the amount the customer hands in and print any change due.




The program should:




● Change any negative numbers input to 0 (for number of item)




● Tell if the amount customer handed in is less than total (and how much the customer still




owes them)

You are given a string containing ten digits, write a program to print these digits in a human readable format.



There are some rules to how to read a number,



1. Divide the ten digit number into set of four-three-three digits



2.use the following prefixes for consecutive digits



# Single numbers just read them seperately



# 2 successive numbers use double



# 3 successive numbers use triple



# 4 successive numbers use quadruple


Peter is making a new dictionary




Input:42




Output:AP

Ram challenges Anil to a game he decides to give a target word w to Anil .the rules of the game are very simple ram gives Anil n sentence one by one and asks Anil to print the first sentence which contains the given word w. If the sentence numbering starts from 1, can you identify the first sentence. Number containing the word W?

reorder the string.eren wants to modify a string.the string can contain only positive integers.he wants to change the string in such a way that the smaller numbers should appear before the bigger numbers.given a string write a program to help eren to modify the string

there are N pyramids in a line.you are given their Heights as a list of integers. write a program to print the minimum absolute difference between the heights of any two different pyramids.

riya took part in a maths quiz competition to win the prize




money she hass to solve a tricky question at the end for a




given list of integers write a program where all the integers




in a given index range have to be added she will be given M multiple




rangs where she should print the sum of numbers for each corresponding range




'''






LowerBound=1




UpperBound = 10






for r in range(LowerBound,UpperBound):




Sum = Sum + r




print("Sum of range: %d : %d = %d"%(LowerBound,UpperBound,Sum))

LATEST TUTORIALS
APPROVED BY CLIENTS