Computer Science, asked by thelovaticnabiya, 3 days ago

Answer the following questions the right will be marked brain list​

Attachments:

Answers

Answered by aj200260
0

Answer:

1.

n = 5

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

   for m in range(1, a+1):

       print(m, end="")

   print()

2.

l = int(input("Enter lower range: "))  

u = int(input("Enter upper range: "))  

 

for n in range(l,u + 1):  

  if n > 1:  

      for a in range(2,n):  

          if (n % a) == 0:  

              break  

      else:  

          print(n)  

3.

price=int(input("Enter the price of the item:"))

qty=int(input("Enter the amount of quantities sold:"))

if qty>500:

   totalprice=price * qty

   discount=10 * totalprice / 100

   print("amount payable is",discount)

elif qty<=500:

   totalprice=price * qty

   price=5 * totalprice / 100

   print("amount payable is",discount)

PLEASE MARK ME AS BRAINLIEST

THANK YOU!

Answered by anindyaadhikari13
2

Solution 1:

This is the required Python program for the Pattern.

for i in range(1,6):

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

       print(j,end=" ")

   print()

Solution 2:

This is the required Python program for the question.

start=int(input("Enter the starting range: "))

end=int(input("Enter the ending range: "))

print("Odd numbers in the given range are as follows - ")

for i in range(start,end+1,2):

   print(i,end=" ")

Solution 3:

This is the required Python program for the question.

price=int(input("Enter price: "))

quantity=int(input("Enter quantity: "))

total=price*quantity

discount=0

if quantity>500:

   discount=10

elif quantity>=250 and quantity<=500:

   discount=5

total-=total*discount/100

print("Total amount payable =",total)

See the attachments for output.

Attachments:
Similar questions