# Obtain the last three numerical digits of the PI PI = (input("enter PI number:")) XYZ = PI[-3:] # Use the three digits to create the number 1.01XYZ def individual_number(): individual_number = (1.01 + XYZ) # Return the individual number return individual_number # Write the PI and individual number in the document # ask the user for fat grams and carbohydrate grams fat_grams = int(input("Enter the number of fat grams: ")) carb_grams = int(input("Enter the number of carbohydrate grams: ")) # calculate the number of calories from fat and carbs cal_fat = fat_grams * 9 cal_carb = carb_grams * 4 # calculate the total number of calories cal_total = cal_fat + cal_carb # calculate the estimated number of calories using the individual number cal_estimated = round(cal_total * 1.01 + XYZ) # print the result to the user print("Estimated number of calories:", cal_estimated) this is my code and the error i am getting, help please
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:
# Obtain the last three numerical digits of the PI
PI = (input("enter PI number:"))
XYZ = PI[-3:]
# Use the three digits to create the number 1.01XYZ
def individual_number():
individual_number = (1.01 + XYZ)
# Return the individual number
return individual_number
# Write the PI and individual number in the document
# ask the user for fat grams and carbohydrate grams
fat_grams = int(input("Enter the number of fat grams: "))
carb_grams = int(input("Enter the number of carbohydrate grams: "))
# calculate the number of calories from fat and carbs
cal_fat = fat_grams * 9
cal_carb = carb_grams * 4
# calculate the total number of calories
cal_total = cal_fat + cal_carb
# calculate the estimated number of calories using the individual number
cal_estimated = round(cal_total * 1.01 + XYZ)
# print the result to the user
print("Estimated number of calories:", cal_estimated)
this is my code
and the error i am getting, help please
![# Obtain the last three numerical digits of the PI
PI = (input ("enter PI number: "))
XYZ = PI [-3:]
# Use the three digits to create the number 1.01XYZ
def individual_number ():
individual_number=
(1.01 + XYZ)
# Return the individual number
return individual_number
# Write the PI and individual number in the document
# ask the user for fat grams and carbohydrate grams
fat_grams = int (input ("Enter the number of fat grams: "))
carb_grams = int (input ("Enter the number of carbohydrate grams: "))
# calculate the number of calories from fat and carbs
cal_fat = fat grams
9
cal_carb = carb_grams * 4
# calculate the total number of calories
cal_total = cal_fat + cal_carb
# calculate the estimated number of calories using the individual number
cal_estimated = round (cal_total* 1.01 + XYZ)
#print the result to the user
print ("Estimated number of calories:", cal_estimated)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F47200b4c-a8f9-447b-94f9-99e5421d54a1%2F148aa858-e03c-43e7-8a05-a772c31c306e%2Ffakszzq8_processed.jpeg&w=3840&q=75)

Step by step
Solved in 2 steps with 2 images









