Computer Science, asked by fxxx, 6 months ago

write a program in python for the ^​

Attachments:

Answers

Answered by anindyaadhikari13
1

Question:-

  • Write the following programs in Python.

Programs:-

For Question 1.

n=float(input("Enter your yearly salary: "))

tax=0

if (n<250000):

tax=n*0/100

elif (n<500000):

tax=n*10/100

else:

tax=n*20/100

print("Income tax: ",tax)

For Question 2.

n=int(input("Enter the number of rows: "))

for i in range(1,n+1):

for j in range(0,2*i-1):

print("*", end=" ")

print()

For Question 3.

n=int(input("Enter the number of rows: "))

for i in range(0,n):

for j in range(n, i, -1):

print(j, end=" ")

print()

Answered by kunjika158
0

Answer

5.0/5

1

anindyaadhikari13

   Genius

   4.9K answers

   2.2M people helped

1.

n=float(input("Enter your yearly salary: "))

tax=0

if (n<250000):

tax=n*0/100

elif (n<500000):

tax=n*10/100

else:

tax=n*20/100

print("Income tax: ",tax)

2.

n=int(input("Enter the number of rows: "))

for i in range(1,n+1):

for j in range(0,2*i-1):

print("*", end=" ")

print()

3.

n=int(input("Enter the number of rows: "))

for i in range(0,n):

for j in range(n, i, -1):

print(j, end=" ")

print()

Similar questions