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 a python program to read in the number of judges at a competition and then read in the mark for each judge. Write out the highest mark, lowest mark and final mark.


The number of judges must be from 4 to 8.

Each judge can only give marks from 0.0 to 10.0


write python program that reads in the number of judges at a competition and reads in a mark for each judge. write out the highest mark, lowest mark and final mark.


Exercise 6.4.

A number, a, is a power of b if it is divisible by b and a/b is a power of b. Write a function called is_power that takes parameters a and b and returns True if a is a power of b. Note: you will have to think about the base case.


After writing your is_power function, include the following test cases in your script to exercise the function and print the results:

print("is_power(10, 2) returns: ", is_power(10, 2))

print("is_power(27, 3) returns: ", is_power(27, 3))

print("is_power(1, 1) returns: ", is_power(1, 1))

print("is_power(10, 1) returns: ", is_power(10, 1))

print("is_power(3, 3) returns: ", is_power(3, 3))






Write a function to take the Celsius value as an argument and return the corresponding Fahrenheit value.

Write a program to print the following,


Input

The first line contains a string representing a scrambled word.

The second line contains some space-separated strings representing words guessed by the player.


Output

The output should be a single integer of the final score.


Explanation

scramble word = "tacren"

guessed words = ["trance", "recant"]


Since "trance" and "recant" both have length 6 then you score 54 pts each.

So the output is 108.


Sample Input1

tacren

trance recant

Sample Output1

108


Sample Input2

rceast

cat create sat

Sample Output2

2


Write a program to print the following, Given a word W and pattern P, you need to check whether the pattern matches the given word.The word will only contain letters(can be Uppercase and Lowercase). The pattern can contain letters, ? and *.

? : Can be matched with any single letter.
* : Can be matched with any sequence of letters (including an empty sequence).


If the pattern matches with the given word, print True else False.


Sample Input1

3

Hello *l?

Hell He?ll

Hell ?*

Sample Output1

True

False

True


Sample Input2

3

Hello Hell*

Hell He*ll

Hell hell*

Sample Output2

True

True

False


TIC-TAC-TOE

ravan's dream is to win the tic-tac-toe champions to accomplish this,the practices alone at home to learn the strategies in the game your task is to identify the cell where ravan should place his 3rd piece so that be wins the game Assume that each cell in the tic-tac-toe board is marked with number as shown in the table below

tic tac toe

0 1 2

3 4 5

6 7 8

input:

the 1st line of input contains two space-separated integers represetation the cells where ravan has placed his 1st two piece

i/P:

0 1

o/P: 2

i/p: 0 3

o/p:6


substring:

you are given two strings N &K your goal is to determine the smallest substring of N that contains all the characters in K If no substring present in N print No matches found

note: if a character is repeated multiple time in K your substring should also contain that character repeated the same no.of times

i/p:the 1st line input two strings N&K

input:

stealen lent

o/p:

tealen

i/p:

tomato tomatho

no matches found



Discount sale:

it is a summer discount sale in mumbai and all the local shops have put up various offers Arjun selected N items to buy while standing in the building queue,he noticed the offer "buy two !" get two FREE!".this means that for every two items he buys they give him two items for free however ,items can be of varying prices they always charge for two most costly items and give the other two as free.Arjun is confused with grouping his items to reduce the total price he has to pay your task is to find the minimum price arjun has to pay to buy all the N items

input:the 1st line contains a single integer N

the 2nd line has N space-separated integers representing the cost of items

input:

4

1 1 2 2

o/p:4

i/p:

2

10 200

output:

210


candies:

Rose bought 3 boxes of candies each box contains candies only of one specific flavor

box1:blue raspberry flavor

box2:butterscotch flavor

box3:cherry flavor

each day rose eats exactly two candies flavor(she won't eat two candies of the same flavor in a day)she won't eat more than 2 candies or 1 candy in a day .your task is to find the maximum number of days rose can keep eating candies.

input:

the 1st line input contains 3 space-separated integers A,B,C denoting the no.of blue raspberry, butterscatch and cherry candies respectively

input: 1 1 1

output:1

i/p:1 2 1

o/p:2


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS