Advertisements
Advertisements
Question
Write the output of the code given below:
p=5
def sum(q,r=2):
global p
p=r+q**2
print(p, end= '#')
a=10
b=5
sum(a,b)
sum(r=5,q=1)
Solution
Output:
105#6#
APPEARS IN
RELATED QUESTIONS
Jan Lukasiewicz in the 1920s introduced the concept of:
Arithmetic operations are not represented as:
Numbers a and b are added together and numbers c and d are also added together. The two sums are then multiplied. What is the correct way of putting it in infix?
Which data structure is commonly used for conversion of infix expression to post or prefix expression?
1 2 + 3 4 -* when written as prefix would look like:
Which of the following is a postfix operation?
Which of the following is neither infix nor prefix nor postfix?
State TRUE or FALSE for the following case:
In POSTFIX notation for expression, operators are placed after operands.
For the following arithmetic expression:
((2+3)*(4/2))+2
Show step-by-step process for matching parentheses using stack data structure.
Evaluate following postfix expression while showing status of stack after the operation given A = 3, B = 5, C = 1, D = 4.
A B + C *
Evaluate following postfix expressions while showing status of stack after the operation given A = 3, B = 5, C = 1, D = 4.
A B * C / D *
What will the following expression be evaluated for in Python?
print(15.0 / 4 + (8 + 3.0))
What will the following expression be evaluated for in Python?
print (4 + 3 * 5/3 − 5 % 2)