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

You are given N inputs. Write a program to print the first prime number in the given inputs


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)


Write a program to print

W pattern of N lines using an asterisk(*) character as shown below.

Note: There is a space after each asterisk * character


Given an integer value

N as input, write a program to print a shaded diamond of 2*N -1 rows using an asterisk(*) character as shown below.

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


 * 

   * * 

  * * * 

 * * * * 

* * * * * 

  *     *

*   *

   * *

    *


Given an integer

N as input, write a program to print a number diamond of 2*N -1 rows as shown below.

Note: There is a space after each number


 1 

   1 2 

  1 2 3 

  1 2 3 4 

1 2 3 4 5 

 1 2 3 4 

  1 2 3 

   1 2 

    1

  


Given an integer N as a starting number and K as input, write a program to print a number pyramid of K rows as shown below


input1 : 10

5

10

11 12

13 14 15

16 17 18 19

20 21 22 23 24


input2: 1

3

1

2 3

4 5 6





Maximum

n = int(input())
line = []

for i in range(0, n):
  line.append(input())
  print(max(line))

In this python program it has three test cases, in this three test cases two test cases was getting expected output and third test case are not getting expected output. Please give me expexted output for three test cases. Thank you !


Question Url :-

https://docs.google.com/document/d/1z0yr9wfjkiTADlYer1IJgNn2w8x3_HJG/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true


Test Case 1

Input

6

1


3

2

9

8

Output

1

1

3

3

9

9

Test Case 2

Input

5

1

2

3

4

5

Output

1

2

3

4

5

Test Case 3

Input

4

10

9

8

7

Output

10

10

10

10


Write a python program which takes a number from the user and prints if it is positive if it is a multiple of 10. Hint: Odd numbers cannot be a multiple of 10.

Write a program to print T in all scales viz Celsius, Fahrenheit, and Kelvin.

Formula to convert from Fahrenheit F to Celsius C is C = (F - 32) * 5 / 9.


Given an integer N as input, write a program to print a number diamond of 2*N -1 rows

Note: There is a space after each number


LATEST TUTORIALS
APPROVED BY CLIENTS