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
|
Operators with the same precedence are evaluated in which manner?
Solution |
2
Discuss
|
The one’s complement of 110010101 is:
Solution |
3
Discuss
|
Mathematical operations can be performed on a string.
Solution |
4
Discuss
|
What will be the value of the following Python expression?
Solution |
5
Discuss
|
What is the answer to this expression, 22 % 3 is?
Solution |
6
Discuss
|
What is the value of the following expression?
Solution |
7
Discuss
|
What is the order of precedence in python? i) Parentheses |
8
Discuss
|
Given a function that does not return any value, What value is thrown by default when executed in shell.
Solution |
9
Discuss
|
The following is displayed by a print function call. Select all of the function calls that result in this output.
Solution |
10
Discuss
|
Which of the following results in a SyntaxError?
Solution |
# | Quiz |
Copyright © 2020 Inovatik - All rights reserved