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

Hollow Right Triangle

Given an integer number N as input. Write a program to print the hollow right-angled triangular pattern of N lines as shown below.

Note: There is a space after each asterisk (*) character.

Input

The first line of input is an integer N.

Explanation

In the given example the hollow right angled triangle of side

4. Therefore, the output should be

* * * *

* *

* *

*


Sample Input 1

4

Sample Output 1

* * * *

* *

* *

*

Sample Input 2

6

Sample Output 2

* * * * * *

* *

* *

* *

* *

*




Give an array of integers representing measurements in inches, write a program to calculate the total of measurement in feet ignore the measurement those who are less than a feet (e.g10)

in the above case only armstrong numbers can be printed.For,Example consider the two number that is "A" value should be 10 and "B" value should be 15. There is no armstrong number between these two intervals so we need to print a"-1".but the output should be shown empty value.how could we print -1 please explain that code


In a company if an employee is paid as under: If his basic salary is less than Rs. 1500, then HRA=10% of basic salary and DA=90% of basic salary. If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the employee's salary is input through the keyboard write a program to find his gross salary.
Index of last occurrence

Write a program that uses two input statements to get two words as input. Then, print the words on one line separated by a space. Your program's output should only include the two words and a space between them.

Hint: To print both words on one line, remember that you can concatenate (add) two phrases by using the + symbol. Don't forget that you'll need to add a space between the words as well.

Sample Run

Enter a word: Good
Enter a word: morning
Good morning





What is the value of pairs after the following assignment?
pairs = [ (x,y) for x in range(5,1,-1) for y in range(4,1,-1) if (x+y)%3 == 0 ]

Write code to output the following:

    My favorite quote is, "Money talks"


Write a code to find out the sum of the sequence 2 -4 6 -8 10 -12.... while the last value will be determined from input. Use a loop to solve the problem.


Write a python program that asks the user to input six numbers and then print the summation and average of odd numbers only.

Sample Input:

3

5

2

4

8

9

Sample Output: Summation is 17 and average is 5.666666666666667


LATEST TUTORIALS
APPROVED BY CLIENTS