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

Write an application that plays "guess the number" as follows: Your program chooses the number to be guessed by selecting a random integer in the range 1 to 1000. The application displays the prompt Guess a number between 1 and 1000. The player inputs a first guess. If the player's guess is incorrect, your program should display Too high. Try again. or Too low. Try again. To help the player "zero in" on the correct answer, the program should prompt the user for the next guess. When the user enters the correct answer, display Congratulations. You guessed the number!, and allow the user to choose whether to play again.


Also, count the number of guesses the player makes. If the number is 10 or fewer, display Either you know the secret or you got lucky! If the player guesses the number in 10 tries, display Aha! You know the secret! If the player makes more than 10 guesses, display You should be able to do better!


Would you know how a gymnastics competition is scored? Well, for each performance, each judge gives a score in the range 1 to 10. Then, the highest and the lowest scores are canceled, and the rest are averaged. The average is the score of the performance.


For example, suppose there were 7 judges, and the performance gets the following scores.


9.20


9.00


8.75


9.40


9.60


8.90


9.60


The average would be 9.22 (that's (9.2+9.0+9.4+9.6+8.9)/ 5).


Write a python program that read 7 scores as input and outputs the average. The program should us an array of floats. Note that you need to determine the highest and the lowest score and exclude them in the computation.


Below is a sample output of this exercise.


Enter 7 scores: 9.20


9.00


8.75


9.40


9.60


8.90


9.60


High Score: 9.60


Low Score: 8.75


Average Score : 9.22



How to find input as operation



Explain:



It is subtraction operator given two numbers -150 - -100



Input:



-150 - -100



Output:



50



Input:



150 + 50



Output:



250

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


Sample Input1

2

shakti 24

disha 26

Sample Output1

shakti disha


Sample Input2

3

ajay 23

bijay 24

sanjay 23

Sample Output2

ajay bijay


Smaller Scores

A group of people(P) are playing an online game. Their scores are stored in the order of their entry time in S. Each integer S[i] corresponds to the score of the person Pi.

For each person Pi you have to report the number of people who played after the person and scored less than the person.


Input

The first line contains a single integer N.

The second line contains N space-separated


Output

The output should contain N space-separated integers representing the number of people who played after the person and scored less than the person.


Explanation

Given S = 13 12 11 Score of P1 is 13. Score of P2 is 12. Score of P3 is 11.The number of people who played after P1 and scored less than 13 is 2(12, 11). The number of people who played after P2 and scored less than 12 is 1(11). The number of people who played after P3 and scored less than 11 is 0.The output is 2 1 0.


Sample Input 1

3

13 12 11

Sample Output 1

2 1 0

Sample Input 2

4

4 3 5 2

Sample Output 2

2 1 1 0



• Create class passenger, bus and seat. Each Seat object has three attributes, i.e., seat number, availability flag (1 if the seat is available, 0 otherwise), and an occupant (empty string is the seat is still available, otherwise a Passenger object).

• Each Passenger has a name and can purchase a Seat in a Bus. purchase_seat function needs a seat number (not a Seat object) and the Bus object. If that particular seat is available (as indicated by its availability flag), it will be assigned to that passenger. 

• Each object of Bus class is composed of 24 Seat objects. Bus object also has a ticket price per seat attribute and a total booking amount attribute. Use a loop in the constructor to create 24 Seat objects. As seats are purchased by passenger, their ticket price is added to total booking amount attribute. Bus has a display function in which each Seat object of the Bus calls display function of Seat class. 

• Create a Bus object, and two passenger objects. Both passengers try to buy seat 15



write this python code using data Classes 

4. Create a class SalariedEmployee 

a. SalariedEmployee class is a child class of Employee class. It should inherit all the attributes of

Employee class and add its own attribute baseSalary.

b. Create a method called CalculateNetSalary which should deduct 13% Provisional Tax, 1%

insurance and 3% Fed Tax from baseSalary and display the NetSalary.

c. Create a method called displayData which should display the FirstName, LastName, Age,

Address, ContactNumber, EmployeeID, OrganizationName, Position, baseSalary and

NetSalary.


5. Create a class BasePlusCommissionEmployee 

a. BasePlusCommissionEmployee class is a child class of CommissionEmployee. It should inherit

all the attributes of CommissionEmployee class and add its own attribute baseSalary.

b. Create a method called calculateTotalEarning which should inherit super class method

calculateCommission and add baseSalary in it.


Given a list of different right and left foot shoes, write a python code to return the exact number of shoe pairs which can be formed from the given list. Also, return how many number of shoes of which foot are required to form pairs with the unpaired shoes.







Input Format







Input_list = ['R','L','L','R','R',R','R,'L']







Constraints







.







Output Format







Paired: 3







Unpaired: 2







Required left Shoes







Sample Input 0







8





L R L L R L R L





Sample Output 0







Paired: 3





Unpaired: 2





Required right shoes





Sample Input 1

Perfect squares In a range


for example sample input= 4 , print right angle trangle in numbers like ,reverse order

1

121

12321

1234321

like this can solve this for mee ?


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS