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

1. Batsman with best strikerate and average in different total runs range a. 1-1000, 1000-2000, 2000-3000 and so on up to maximum runs.

2. Find Best bowler and best batsman. 

3. Maximum catches, maximum extra runs, etc.

4. Any other question of your choice.


Write a program that will ask a user for how many numbers they would like to check. Then, using a for loop, prompt the user for a number, and output if that number is even or odd. Continue doing this as many times as the user indicated. Once the loop ends, output how many even numbers were entered and how many odd numbers were entered.

Sample Run 1

How many numbers do you need to check? 5
Enter number: 20
20 is an even number.
Enter number: 33
33 is an odd number.
Enter number: 4
4 is an even number.
Enter number: 77
77 is an odd number.
Enter number: 8
8 is an even number.
You entered 3 even number(s).
You entered 2 odd number(s).

Sample Run 2

How many numbers do you need to check? 3
Enter number: 10
10 is an even number.
Enter number: 3
3 is an odd number.
Enter number: 400
400 is an even number.
You entered 2 even number(s).
You entered 1 odd number(s).






Area of Largest Rectangle in Histogram:

Given a list of integer heights representing the histograms bar height where the width of each bar is 1, return the area of largest rectangle in the histogram.

Input: The input will be a single line containing space-separated integers, denoting the heights of the bars.

Output: The output should be a single line containing the area of the largest rectangle in the rectangle.

Sample Input 1:

2 1 5 6 2 3

Sample Output 1:

10

Sample Input 2:

65 87 96 31 32 86 57 69 20 42

Sample Output 2:

248


Palindrome Pairs:

Given a list of unique words, write a program to print all the pairs of the distinct indices (i,j) in the given list, so that the concatenation of two words at the indices i and j is a palindrome.

Input: Input will be a single line containing a sentence.

Output: The output should be printing each distinct pair of indices (i,j) each in a line in ascending order. If there are no distinct pairs found, print "-1"

Note: Consider (i,j) and (j,i) as two different pairs.


Closest palindrome Number:

Given a string N, representing an integer, return the closest integer(not including itself), which is palindrome. If there is a tie, return the smaller one. The closest is defined as the absolute difference minimized between two integers.

Input:

The input will be a single line containing an integer.

Output:

The output should be a single line containing a closest palindrome number to the given integer.

Explanation:

For example, if the given integer is 19, the palindrome number greater than 19 is 22 and the palindrome number less than 19 is 11. As 22 is closest to the number 19. So the output should be 22.


For each function, describe what it actually does when called with a string argument. If it does not correctly check for lowercase letters, give an example argument that produces incorrect results, and describe why the result is incorrect.

# 3

def any_lowercase3(s):

   for c in s:

     flag = c.islower()

   return flag


For each function, describe what it actually does when called with a string argument. If it does not correctly check for lowercase letters, give an example argument that produces incorrect results, and describe why the result is incorrect.

# 2

def any_lowercase2(s):

   for c in s:

     if 'c'.islower():

        return 'True'

     else:

        return 'False'


For each function, describe what it actually does when called with a string argument. If it does not correctly check for lowercase letters, give an example argument that produces incorrect results, and describe why the result is incorrect.

# 1

def any_lowercase1(s):

   for c in s:

     if c.islower():

        return True

     else:

        return False


2. Write a program which creates a class named babyRecord with four methods.

a) One method will be used to write details of a child including date of birth, name, parent

names and hospital name into a file called baby_data.txt.

b) The second method will be used to read from the file baby_data.txt and store the data in a

dictionary called records.

c) The third method will be used to search for a baby using baby name or parent names

information in the file called baby_data.txt.

d) The last method will be used to delete records in the dictionary and file respectively.

e) Clearly show how exceptions are handled in your program in each method.


If an input is “General” then the output should be G_e_n_e_r_a_l



please can u solve this type code


LATEST TUTORIALS
APPROVED BY CLIENTS