Login
Congrats in choosing to up-skill for your bright career! Please share correct details.
Home / Blog / Interview Questions / Top Python Programming Interview Questions and Answers
Bharani Kumar Depuru is a well known IT personality from Hyderabad. He is the Founder and Director of AiSPRY and 360DigiTMG. Bharani Kumar is an IIT and ISB alumni with more than 18+ years of experience, he held prominent positions in the IT elites like HSBC, ITC Infotech, Infosys, and Deloitte. He is a prevalent IT consultant specializing in Industrial Revolution 4.0 implementation, Data Analytics practice setup, Artificial Intelligence, Big Data Analytics, Industrial IoT, Business Intelligence and Business Management. Bharani Kumar is also the chief trainer at 360DigiTMG with more than Ten years of experience and has been making the IT transition journey easy for his students. 360DigiTMG is at the forefront of delivering quality education, thereby bridging the gap between academia and industry.
Table of Content
The Python mathematical basic operations are provided in the table below. There are various other advanced operations, which can be formulated by combining these basic operations.
Python libraries that are used in performing such operations include – Math, Numpy, Scipy, to name a few.
While addition, subtraction, multiplication & division is straight forward, integer division, exponentiation, and Modulo are slightly different than the normal.
Go to Python terminal & execute the following lines:
Python operates in the same way as your mathematical operations work. Using PEMDAS!
Go to Python terminal & execute the following lines.
Observe the difference in the last 2 lines of code & its corresponding results.
Integer is all about numbers without decimals (whole numbers, e.g. -2, -1, 0, 1, 2, etc) and Float is all about numbers with decimals (e.g. -2.8, -1.6, 0.0, 1.1, 5.9, etc)
Variables are critical components of any programming language and Python is no different. We store elements of a variety of types in the memory slot called Variables. However, the reverse assignment does not work and will throw an error as shown in the image.
Shorthand variant of performing an operation is provided in the screenshot below.
A variable cannot start with numbers or special characters. Please refer to the screenshot listed underneath for a better understanding.
Comments in Python can be provided in many ways.
Refer to the below screenshot for more understanding.
Whenever one has to define a String they can do it either by entering text in single quotes (‘ ‘) or double quotes (“ “). Either of these can be used, however, the best practice is to use double quotes because if you have to define a String such as names (Bharani’s) in single quotes then there will be an error that you will encounter. Please refer to the screenshot for a better understanding.
360DigiTMG - Data Science, Data Scientist Course Training in Bangalore
No 23, 2nd Floor, 9th Main Rd, 22nd Cross Rd, 7th Sector, HSR Layout, Bengaluru, Karnataka 560102
+91-9989994319 1800-212-654-321
Didn’t receive OTP? Resend
Let's Connect! Please share your details here