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

Problem 1: Add a buyLotsOfFruit(orderList) function to buyLotsOfFruit.py which takes a list of (fruit,pound) tuples and returns the cost of your list. If there is some fruit in the list which doesn't appear in fruitPrices it should print an error message and return None (which is like nil in Scheme). Please do not change the fruitPrices variable.

Test Case: We will check your code by testing that the script correctly outputs Cost of [('apples', 2.0), ('pears', 3.0), ('limes', 4.0)] is 12.25


A certain charity designates donors who give $10,000.00 or more as

Benefactors; those who give $1,000.00 or more but less than $10,000.00 as

Patrons; those who give $200.00 or more but less than $1,000.00 as Supporters;

those who give $15.00 but less than $200.00 as Friends; and those who give

less than $15 as Cheapskates.

Write a program containing a nested if-else statement (or statements) that,

given a keyboard input with the amount of a contribution, outputs the correct

designation for that contributor.

Here’s an example that illustrates what your program should look like in

action:

~/ python donor.py

Enter the amount of a contribution: $5.20

Cheapskate!

Test your program also for the input values: 10000.00, 1000.00,

999.99, 12200.00,15.00, 499.99, 2200.00, 199.99, 75.33

An appropriate error message should be output (and your program should halt) when

an amount less than 0 is input.


Riya took part in a maths quiz competition. To win the prize money she has 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 to be added.
She will be given M multiple ranges, where she should print the sum of numbers for each corresponding range.

Note: The limits in the range are both inclusive.

Input
The first line f input is space-separated integers.
The second line of input is a positive integer M denoting the number of index ranges.
The next M lines contain two space-separated integers of the range.

Output
The output should be M lines.
Each line contains an integer that represents the sum for the corresponding ranges.

Sample Input1
1 3 4 5 6
5
3 5
Sample Output1
12

[Please test the sample test cases and send the screenshots].

write a program find mean,median and mode by using functions in python



Write a python that reads several lines of text and print a table indicating number of one-letter words, two-letter words, etc.appearing in the text.

For example, the phrase; Whether 'tis nobler in the mind to suffer.


The output will be:


Word length Occurrences

1 0

2 2

3 1

4 2 (including 'tis)

5 0

6 2

7 1


In this assignment, you are asked to demonstrate a program which uses the container class in Python, i.e. list and dict, to automatically find all the duplicated book items in the UTAR library collection. You can only use the Python built-in functions to perform the task. Use of any advanced modules other than csv, such as pandas and numpy, will immediately lead to a zero mark.

 

Your task in this assignment is to find out the total number of duplicated titles in the input file called library-titles.csv.

there multiple(t) book stores in the area. each bookkeeper has a list of b integers that represents the cost of each book. you have different pocket money(p) for each bookstore. write program to calculate the maximum number of books you can buy in each store with the corresponding pocket money. in python


3 Minutes 20 Seconds - line vastundhi sir output lo .how can remove this (-) line sir.

question: single entry



akshya is given a list of N integers. Each number in the list appears exactly for one number. help akshya by identifying the numbers which appeared exactly once in the list.



input:-



2 2 1



output:-



1



input:



8 9 2 8 9 2 5



output:



5



explanation:



in the example the given integers are 2 2 1 as the number 1 has appeared only once.


so the output should be 1.




question:- string encoding


arya has two strings S and T consisting of lower case english letters.

since he loves encoding the strings, he dose the operation below just once on the string S


first, arya thinks of a non- negative integer K then he shifts each character of S to the right

by K


explanation:- 1) in the first example the given strings are S= abc and T= ijk.


when arya chooses K=8

"a" is shifted to the right by 8 and become "i"

"b" is shifted to the right by 8 and become "j"

"c" is shifted to the right by 8 and become "k"


2) in the second example, the given string are S=ppq and T=qqp

there is non-negative integer K that arya can choose to transform S into T so, No should be printed.


input: abc

ijk

output: Yes


input: ppq

qqp

output: No






LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS