You are on page 1of 1

DAY-1 Assignment Revision Tour Python

Q1. Which of the following is valid identifier?


a) Serial_no. b)total-Marks c) _Percentage d) Hundred$
Q2. Add a pair of parentheses to each expression so that it evaluates to True.
a) 2+3==4+5 ==7 b)0 ==1 ==2
Q3. What will be the output of following expressions:
a) 2**3**2 b) (2**3)**2
Q4. Consider the following program and predict the output:
num1 =input("Enteranumberand I'lltriple it:") #num1=8
num1 =num1 *3
print(num1)
Q5. Which of the following statement(s) would give an error after executing the following code?

S="LucknowistheCapitalofUP"#Statement1
print(S) #Statement2
S[4]='$’ #Statement3
S="Thankyou" #Statement4
S=S+"Thankyou" #Statement5

(a) Statement3 (b) Statement4 (c) Statement5 (d) Statement4and5

Q6. What will be the output of this code


>>>L1=[8,11,20]
>>>L1*3
Q7. Assertion(A):Function is defined as a set of statements written under a specific name
In the python code.
Reason(R): The complete block (set of statements) is used at different instances in
Theprogram as and when required,referring the function name. It is a common code to
execute for different values(arguments),provided to a function.

Q8. Rewrite the following code in python after removing all syntax error(s). Underline each
Correction done in the code.
30=n
For i in range(0,n)
IFi%4==0:
print(i*4)
Else:
print(i+4)
Q9. Identify the incorrect keyword name:
a) int b) float c) while d) true

Q10. What will the following expression be evaluated to in Python?


27 % 7 // (3 / 2)
a) 2 b) 2.0 c) 4.0 d) 4

You might also like