Register Now


Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.


Register Now

It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways

Python Analytics interview questions 1-5

Python Analytics interview questions
In this series, we will add some of the basic questions to start with Python. Slowly we will move to moderate level DSA questions followed by Pandas, Numpy, and OS module.
All you need to do is to install Python in your system and start from scratch.

Python Analytics interview questions

We will try to solve each question in multiple ways, if you are missing out on the basics then do consult Tutorialspoint or w3school. Invest around 6 hours on these websites and you should be good to go

Python Analytics interview questions

Python Basic Question

1. Take input of two numbers from users and find out the maximum

a = input("Enter first number :")
b = input("Enter second number ")
if a>b:
print(a + " is greater than " + b)
print(b + " is greater than "+a)


a = 30
b = 40
print(a if a>b else b)


a = 10
b = 30
c = max(a,b)

2. Print the factorial of any number

a = 10
def fact(n):
if (n == 1 or n==0):
return 1
return n*fact(n-1)


import math
Python Analytics interview questions

3. Get square of the number if the number is odd and cube if even

def yoo(n):
if (n%2 == 0):
return nnn
return n*n

4. Print square of first n natural numbers

x = int(input("Enter a natural number = "))
def sum_of_natural(x):
ss = 0
for i in range(1,x):
ss = ss+(i*i)
return ss
print("Sum of square of natural numbers are = " , sum_of_natural(x))
Python Analytics interview questions

5. Find if a number is an Armstrong number.

Example – 153 is an Armstrong number as 1^3+5^3+3^3 = 153

num = int(input("Enter a number = "))
s = 0
x = num
while (x >0 ):
digit = x%10
s = s+(digitdigitdigit)
x = x//10
print("Armstrong" if s == num else "Not Armstrong")
Python Analytics interview questions

The Data Monk Interview Books – Don’t Miss

Now we are also available on our website where you can directly download the PDF of the topic you are interested in. At Amazon, each book costs ~299, on our website we have put it at a 60-80% discount. There are ~4000 solved interview questions prepared for you.

10 e-book bundle with 1400 interview questions spread across SQL, Python, Statistics, Case Studies, and Machine Learning Algorithms – Ideal for 0-3 years experienced candidates

23 E-book with ~2000 interview questions spread across AWS, SQL, Python, 10+ ML algorithms, MS Excel, and Case Studies – Complete Package for someone between 0 to 8 years of experience (The above 10 e-book bundle has a completely different set of e-books)

12 E-books for 12 Machine Learning algorithms with 1000+ interview questions – For those candidates who want to include any Machine Learning Algorithm in their resume and to learn/revise the important concepts. These 12 e-books are a part of the 23 e-book package

Individual 50+ e-books on separate topics

Important Resources to crack interviews (Mostly Free)

There are a few things which might be very useful for your preparation

The Data Monk Youtube channel – Here you will get only those videos that are asked in interviews for Data Analysts, Data Scientists, Machine Learning Engineers, Business Intelligence Engineers, Analytics Manager, etc.
Go through the watchlist which makes you uncomfortable:-

All the list of 200 videos
Complete Python Playlist for Data Science
Company-wise Data Science Interview Questions – Must Watch
All important Machine Learning Algorithm with code in Python
Complete Python Numpy Playlist
Complete Python Pandas Playlist
SQL Complete Playlist
Case Study and Guesstimates Complete Playlist
Complete Playlist of Statistics

About TheDataMonkGrand Master

I am the Co-Founder of The Data Monk. I have a total of 6+ years of analytics experience 3+ years at Mu Sigma 2 years at OYO 1 year and counting at The Data Monk I am an active trader and a logically sarcastic idiot :)

Follow Me