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

IPL Match Details



Write a program that reads all the match outcomes and summarizes the information of all the matches.



Points are given to the teams based on the outcome of the match.



A win earns a team 3 points. A draw earns 1. A loss earns 0.



The following information is expected:



MP: Matches Played



W: Matches Won



D: Matches Drawn (Tied)



L: Matches Lost



P: Points





The team information should be displayed in descending order of points.Input





Names of teams may contain spaces but will be less than 24 characters



100 >= N >= 0





Sample Input



6



CSK;RR;loss



RR;DD;draw



MI;KKR;win



KKR;RR;loss



CSK;DD;draw



MI;DD;draw





Sample Output



Team: RR, Matches Played: 3, Won: 2, Lost: 0, Draw: 1, Points: 7



Team: MI, Matches Played: 2, Won: 1, Lost: 0, Draw: 1, Points: 4



Team: DD, Matches Played: 3, Won: 0, Lost: 0, Draw: 3, Points: 3



Team: CSK, Matches Played: 2, Won: 0, Lost: 1, Draw: 1, Points: 1



Team: KKR, Matches Played: 2, Won: 0, Lost: 2, Draw: 0, Points: 0




Investigatory project on School fee management system.


With synopsis and images.

7. Negative Decimal Tally by CodeChum Admin


We've been giving positive numbers too much attention lately, it's time to let negative numbers take the spotlight this time!


Instructions:


Input four float numbers; they could be positive or negative.


Only add all inputted negative numbers, and print its sum, up to 2 decimal place.


Hint: The previous/latest topic is about if-else-elseif statements, but do we need one here?


Instructions

Input four decimal numbers, they could be positive or negative.

Add all the negative numbers, and print the sum, up to 2 decimal places.


Input

A line containing four decimals/floats separated by a space.


-30.22·10.5·-2.2·-1.8


Output

A line containing a negative decimal/floats with two decimal places.


-34.22


End to End


by CodeChum Admin



Don't you find it amazing to discover words and sentences that have the same first and last letter? We just don't usually notice them, so we can try it out by coding out this problem instead! Print out "Yes" if the first and last characters of the given string are the same, and "No" otherwise. It doesn't matter if they're in lowercase or uppercase, as long as it's the same letter, it fits the description.



So, what are you waiting for? Code now!



Input



A line containing a string.



Pop·it·up


Output



A line containing a string.



Yes

Albert Einstein teaches a business class at Podunk University. To evaluate the students in this class, she has given four tests. It is now the end of the semester and Alberta would like to have a program that inputs each student’s test scores and outputs the average score for each student and the overall class average. (Hint: The outer loop should allow for Ms. Einstein to input all the students, one by one, and the inner loop should accept the four exam scores and compute the average for each student

Write a Python program to print the following string in a specific format

Twinkle, twinkle, little star,

How I wonder what you are!

Up above the world so high,

Like a diamond in the sky.

Twinkle, twinkle, little star,

How I wonder what you are 


Write a Python program to print the following string in a specific format 

Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what you are


Polynomial


Given polynomial,write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1+....+C1x+C0 format.


Input


The first line contains a single Integer N.

Next N lines contain two integers Pi,Ci separated with space, where Pi denotes power and Ci denotes coefficient of Pi.


Sample Input 1

5

0 2

1 3

2 1

4 7


Sample output 1

7x^4 + 6x^3 + x^2 + 3x + 2


Sample input 2

4

0 5

1 0

2 10

3 6


Sample output 2

6x^3 + 10x^2 + 5


Add two Polynomials 


Given two Polynomials A and B,write a program that adds the given two Polynomials A and B.


Sample input 1

4

0 5

1 0

2 10

3 6


Sample Output 1



Sample Input 2

4

0 5

1 0

2 10

3 6

3

0 1

1 2

2 4


Sample output 2

6x^3 + 14x^2 + 2x + 6


Tic-Tac-Toe game


Abhinav and Anjali are playing the Tic-Tac-Toe game.Tic-Tac-Toe is a game played on a grid that's three squares by three squares.Abhinav is O, and Anjali is X.Players take turns putting their marks in empty squares.The first player to get 3 of her marks in a diagonal or horizontal, or vertical row is the winner.When all nine squares are complete,the game is over.If no player has three marks in a row,the game ends in a tie.Write a program to decide the winner inthe Tic-Tac-Toe game.


Input

The input will be three lines contain O's and X's separated by space.


Sample Input 1

O X O

O X X

O O X


Sample Output 1

Abhinav Wins


Sample input 2

O O X

X X O

X O O


Sample output 2

Anjali Wins


LATEST TUTORIALS
APPROVED BY CLIENTS