Nptel - Python For Data Science: Assignment 1 - Solution
Nptel - Python For Data Science: Assignment 1 - Solution
ASSIGNMENT 1 – SOLUTION
1. Answer B - \n
print(object(s), separator=separator, end=end, file=file, flush=flush)
end=’end’ – optional; specify what to print at end. Default is ‘\n’ (line feed)
4. Answer D - %clear
%clear –An easier way to clear the console in Python
5. Answer A – a, b, c = 55
6. Answer C - 3
7. Answer A: a = b
8. Answer C: 10
9. Answer A: int('10.8')
Semantic errors are problems with a program that runs without producing error
messages but doesn't do the right thing
12. Answer D: 6
The name of the variable cannot have special characters such as ‘ . ‘ (dot), %, $, #
etc, they can only have alphanumeric characters and underscore (A to Z, a to z, 0-9
or _ )
14. Answer A: Displays the current Python version
16. Answer C: 5
There are 5 operands in the equation.
19. Answer D: ≤
≤ is not a valid bitwise operator in python.