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

Not getting output please give a corrected code

Secret Message -1


Given a string, write a program to mirror the characters of the string in alphabetical order to create a secret message.


Note: Mirroring the characters in alphabetical order replacing the letters 'a' with 'z', 'b' with 'y', ..., 'z' with 'a'. You need to mirror both uppercase and lowercase characters. You can ignore mirroring for all characters that are not letters.


How can i remove the spaces in output please provide me the proprler answer
Word Count - 2

Given a sentence S, write a program to print the frequency of each word in S, where words are sorted in alphabetical order.

Input

The input will be a single line containing a string S.

Given a string, write a program to print a secret message that replaces characters with numbers 'a' with 1, 'b' with 2, ..., 'z' with 26 where characters are separated by '-'.


Note: You need to replace both uppercase and lowercase characters. You can ignore replacing all characters that are not letters.

input: python learning

output:16-25-20-8-15-14 12-5-1-18-14-9-14-7

Explanation


For example, if the given input is "python", "p" should replaced with "16", similarly"y" with "25","t" with "20","h" with "8","o" with "15","n" with "14". So the output should be "16-25-20-8-15-14".


Numbers in String - 1

Given a string, write a program to return the sum and average of the digits of all numbers that appear in the string, ignoring all other characters.

input:Anjali25 is python4 Expert

output:11

3.67

Explanation:

For example, if the given string is "I am 25 years and 10 months old", the digits of all numbers that appear in the string are 2, 5, 1, 0. Your code should print the sum of all digits(8) and the average of all digits(2.0) in the new line


Numbers in String - 1


Given a string, write a program to return the sum and average of the digits of all numbers that appear in the string, ignoring all other characters.


Input


The input will be a single line containing a string

Please provide proper answer


Composite Numbers in the range

You are 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

The first line of input is an integer M. The second line of input is an integer N.

Explanation

In the given example, the composite numbers present in the range between

2 to 9 are 4, 6, 8, 9.So, the output should be


4

6

8

9


Sample Input 1

2

9

Sample Output 1

4

6

8

9

Sample Input 2

1

4

Sample Output 2

4




Smallest Missing Number

Given a list of numbers, write a program to print the smallest positive integer missing in the given numbers. Input-The input will be a single line containing numbers separated by space. Output-The output should be a single line containing the smallest missing number from given numbers. Explanation-For example, if the input numbers are 3, 1, 2, 5, 3, 7, 7.

The number 1, 2, 3 are present. But the number 4 is not. So 4 is the smallest positive integers that is missing from the given numbers.


Multiples of 3

You are given N inputs. Print the numbers that are multiples of 3.

Input

The first line of input is an integer N. The next N lines each contain an integer as input.

Explanation

In the given example, there are

6 inputs. 1, 2, 3, 5, 9, 6. The numbers 3, 9, 6 are multiples of 3. So, the output should be


3

9

6


Sample Input 1

6

1

2

3

5

9

6

Sample Output 1

3

9

6

Sample Input 2

4

1

3

6

8

Sample Output 2

3

6




Write a program that reads all the match outcomes and summarizes the information of all the matches. A win earns a team 3 points. The team information should be displayed in descending order of points.

Input:

The first line contains a single integer N, denoting the total no. of matches played.

The following N lines contain outcomes of N matches. Each of those lines has information on the teams (T1, T2) which played and the outcome (O) in format T1;T2;O. The outcome (O) is one of 'win', 'loss', 'draw' and refers to the first team listed. The team name may contain spaces.

Output:

The output should contain summarized information of all the matches in a format similar to 'Team: CSK, Matches Played: 4, Won: 2, Lost: 1, Draw: 1, Points: 7' for each team in a new line. If there are no teams to print in summary, print "No Output". Constraints

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

100 >= N >= 0


Multiple of 5

You are given N inputs. Print the given inputs until you encounter a multiple of 5.Input

The first line of input is an integer N. The next N lines each contain an integer as input.

Explanation

In the given example, there are

6 inputs. 1, 2, 3, 5, 9, 6After

3, we have encountered 5, which is a multiple of 5.So, the output should be


1

2

3


Sample Input 1

6

1

2

3

5

9

6

Sample Output 1

1

2

3

Sample Input 2

5

1

2

3

4

5

Sample Output 2

1

2

3

4




LATEST TUTORIALS
APPROVED BY CLIENTS