This Test will cover complete Python with very important questions, starting off from basics to advanced level.
Q. In an interview, following code snippet was provided:
first, second, third = 'red', 'blue', 'green'
first, second, third = second, third, first
complexa, complexb = 1+4j, 4+3j
print(complexa + complexb)
Mark the correct print outputs.
Q. In a competition, following statements were given and Developers were told to mark the False one out of these statements:
Q. A group of developers,were involved in a debate about the features of Java and Python. Following points were raised:
Dev A: The Python interpreter works more at runtime since it finds the type of variables at that time. Since Java is statically typed, this effort is saved. Still, overall Java is slower than Python, as it contains more lines of code. Java should only be used in critical database applications.
Dev B: Java is faster than Python. So in projects, where speed is the issue, we should choose Java. Python is more portable than Java.
Dev C: In critical database applications, Python should be used, as its database access layer, is more stronger than JDBC. Projects where speed is an issue Python should be used, as its code is always smaller than Java.
Mark the correct choice.
Q. A developer was teaching her peer, about negative indices in Python. After explaining the concept, she gave him a test question: