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

If you assign the result of calling a void function to a variable in Python, you get:


Given two integers M, N as input. Write a program to print all the composite numbers present in the given range (including M and N)



Input:



2



9




Fiona has recently started acrylic painting and she is planning to order a few canvases and paints from an online stationery shop. The price of each 10 x 10 sized canvas is 120 tk and the price of each 25 ml paint tube is 75 tk. Depending on the total amount ordered from the shop, she will get some discounts. The table below shows the discount she will get on her total amount.


Total Amount (TK) Discount (TK)

0 - 299 No Discount

300 - 499 10

500 - 749 20

750 - 999 50

>= 1000 150

Write a python program and take two inputs from the user. The first input will be the number of canvases and the second input will be the number of paint tubes ordered. Based on the price of each item, calculate the total amount that Fiona needs to pay including the discount.


Write the Python code of a program that reads an integer, and prints the integer if it is NOT a multiple of 2 OR NOT a multiple of 5.

Write a python function C-F(X) which takes a dictionary containing numbers as input. The function will return a dictionary containing key as a number and value as frequency of how many times the number is repeating in the dictionary. For Ex: 1) {'V': 10, 'VI': 10, 'VII': 40, 'VIII': 20, 'IX': 70, 'X':80, 'XI': 40, 'XII': 20 } is input , then output is { 10: 2 , 20: 2 , 40:2 , 70: 1 }.


2) input: {1: 10, 2: 20, 3: '30', 4: '10', 5: 40, 6: 40} output: {10: 1, 20: 1, '30': 1, '10': 1, 40: 2} .


Function should be general and should work for any finite items dictionary.

write a python function Find_Min_Max(A) (Refer RollNo_W9B_2.py ) which takes a dictionary as input parameter and return the name of student pair having minimum and maximum marks in the class

writing a python function Convert_Dict(A) (Refer RollNo_W9B_1.py )function which take a dictionary as an input and convert it into list of lists

Write a program that draws the three shapes as illustrated in figure 4.2. Think about the concept of composition discussed in chapter 3. Create several smaller functions to perform the basic tasks. Use those functions to build more complicated functions until you have achieved the stated goal.


Describe the difference between a chained conditional and a nested conditional. Give your own example of each.


Lowest and highest score. The teacher gave out the scores of the science quiz conducted last week and asked the ones with the lowest and highest scores to group up. Print the names of the students with minimum and maximum scores, respectively.



Note: In case of a tie, choose the name which comes first in the (dictionary order).



Input : 2



shakti 24



disha 26



output: shakti disha



input: 3



ajay 23



bijay 24



sanjay 23



output: ajay bijay

LATEST TUTORIALS
APPROVED BY CLIENTS