Answer to Question #234936 in Python for sharyu

Question #234936

wants to buy a necklace in which


1. There is a minimum of 1 pearl and maximum of X pearls, such that each pearl


has its own magnificent coefficient.


2. The pearls should be in non-decreasing order of their magnificence power


You are given the maximum number of pearls in a necklace and the range of the magnificent coefficients of the pearls Find the number of necklaces that can be made that follow the mentioned conditions


Input Specificatione


input1: Maximum number of pearls that can be used to form the necklace


input2: Starting magniliomt coefficient of pearls


input3: Ending magnificent coefficient of pearls


Output Specification


Retum the number of necklace options possible as per given conditions


1
Expert's answer
2021-09-09T00:00:52-0400
N=int(input("Maximum number of pearls that can be used to form the necklace: "))
x=int(input("Starting magniliomt coefficient of pearls: "))
s=int(input("Ending magnificent coefficient of pearls: "))
count = N-1
for i in range(N - 1, 0, -1):
    print(1, N, i, "")
print("The count is : ",  count)
p=0
if (x == 0):
    for i in range(N - 1, s, -1):
     print(p + i);
     count+=1;
else:
    for i in range(N - x, s, -1):
        print(i + 1, n, x - 1, p + i + " ")
    



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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS