Yes that is correct. True
Answer:
product_name = input("Enter product name : ")
if product_name=="pen"or"book"or"box"or"pencil"or"eraser":
if product_name == "pen":
amount = 10
print(f"Product Name: {product_name}\nCost: {amount} rupees")
if product_name == "book":
amount = 100
print(f"Product Name: {product_name}\nCost: {amount} rupees")
if product_name == "box":
amount = 150
print(f"Product Name: {product_name}\nCost: {amount} rupees")
if product_name == "pencil":
amount = 5
print(f"Product Name: {product_name}\nCost: {amount} rupees")
if product_name == "eraser":
amount = 8
print(f"Product Name: {product_name}\nCost: {amount} rupees")
else:
print("Item not found!")
Explanation:
The python program is a code of nested if-statements that compares the input string to five items of the first if-statement. For every item found, its code block is executed.
#accepting input from user
n=int(input("Enter a number: "))
#entered number is stored in a temporary variable
temp=n
#initializng required variables
rev=0
dgt=0
#digits are reversed inside while loop
while(n>0):
dgt=n%10
rev=rev*10+dgt
n=n//10
#original number and its reverse are compared
if(temp==rev):
#if equal, it's a palindrome
print("It is a Palindrome")
else:
#if not equal, it's not a palindrome
print("It is not a Palindrome")
#◌⑅⃝●♡⋆♡Nåmřāthā♡⋆♡●⑅◌