What will be the output of the following Python code snippet?
def example(a):
a = a + '2'
a = a*2
return a
>>>example("hello")
indentation Error
cannot perform mathematical operation on strings
hello2
hello2hello2
Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api
# | Quiz |
---|---|
1
Discuss
|
What is the answer to this expression, 22 % 3 is?
Solution |
2
Discuss
|
What will be the value of x in the following Python expression?
Solution |
3
Discuss
|
It is not possible for the two’s complement value to be equal to the original value in any case.
Solution |
4
Discuss
|
In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed.
the objective is to make sure x has an integer value, select all that apply
Solution |
5
Discuss
|
Which one of the following has the highest precedence in the expression?
Solution |
6
Discuss
|
What data type is the object below?
Solution |
7
Discuss
|
Which of the following operators has its associativity from right to left?
Solution |
8
Discuss
|
What is the return value of trunc()?
Solution |
9
Discuss
|
Which one of these is floor division?
Solution |
10
Discuss
|
Operators with the same precedence are evaluated in which manner?
Solution |
# | Quiz |
Copyright © 2020 Inovatik - All rights reserved