score = 0 rating = int(input("Enter star rating: ")) shares = int(input("Enter number of shares: ")) if rating == 1 or 2: if shares < 1000: score = rating*shares*2 print("The score is : ", score) if shares >= 1000: score = rating*shares print("The score is : ", score) if rating == 3 or 4: if shares < 2500: score = rating*shares*3 print("The score is : ", score) if shares >= 2500: score = rating*shares print("The score is : ", score) if rating == 5: if shares < 5000: score = rating*shares*4 print("The score is : ", score) if shares >= 5000: score = rating*shares print("The score is : ", score) This is what I have so far. When I do 3 stars 1000 shares it says: The score is : 3000 The score is : 9000 idk why it does the 3000 one These are the tests it has to pass 1) Test: 1 Star, 450 Shares 2) Test: 2 Stars, 1500 Shares 3) Test: 3 Stars, 1000 Shares 4) Test: 4 Stars, 3500 Shares 5) Test: 5 Stars, 500 Shares 6) Test: 5 Star, 6500 Shares
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
score = 0
rating = int(input("Enter star rating: "))
shares = int(input("Enter number of shares: "))
if rating == 1 or 2:
if shares < 1000:
score = rating*shares*2
print("The score is : ", score)
if shares >= 1000:
score = rating*shares
print("The score is : ", score)
if rating == 3 or 4:
if shares < 2500:
score = rating*shares*3
print("The score is : ", score)
if shares >= 2500:
score = rating*shares
print("The score is : ", score)
if rating == 5:
if shares < 5000:
score = rating*shares*4
print("The score is : ", score)
if shares >= 5000:
score = rating*shares
print("The score is : ", score)
This is what I have so far. When I do 3 stars 1000 shares it says:
The score is : 3000
The score is : 9000
idk why it does the 3000 one
These are the tests it has to pass
1) Test: 1 Star, 450 Shares
2) Test: 2 Stars, 1500 Shares
3) Test: 3 Stars, 1000 Shares
4) Test: 4 Stars, 3500 Shares
5) Test: 5 Stars, 500 Shares
6) Test: 5 Star, 6500 Shares


score = 0
rating = int(input("Enter star rating: "))
shares = int(input("Enter number of shares: "))
if rating == 1 or 2:
if shares < 1000:
score = rating*shares*2
print("The score is : ", score)
if shares >= 1000:
score = rating*shares
print("The score is : ", score)
if rating == 3 or 4:
if shares < 2500:
score = rating*shares*3
print("The score is : ", score)
if shares >= 2500:
score = rating*shares
print("The score is : ", score)
if rating == 5:
if shares < 5000:
score = rating*shares*4
print("The score is : ", score)
if shares >= 5000:
score = rating*shares
print("The score is : ", score)
Step by step
Solved in 4 steps with 7 images









