Answer:
long power(int i)
{
return pow(2,i);
}
Explanation:
The above written function is in C++.It does not uses loop.It's return type is long.It uses the function pow that is present in the math library of the c++.It takes two arguments return the result as first argument raised to the power of second.
for ex:-
pow(3,2);
It means 3^2 and it will return 9.
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.
Answer:the answer is A
Explanation: develop a test to see what kind of circuits it takes to power a oven
Answer:
Using python programming language.
Explanation:
#to define the function write as below
def equal():
#to get the two integers from the user
#The user is asked for input in the code below.
x = int(input("Enter the value for X"))
y= int(input("Enter the value for y"))
if x==0 and y==0:
print("both numbers are ", "0")
elif: x==1 and y==1: #This test if both x and y are 1
print("true")
elif: x==y: #this line test if both values are equal
print("true")
else:
print("False")
equal() #end of the function