## 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.

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)else:print(b + " is greater than "+a)or a = 30b = 40print(a if a>b else b)or a = 10b = 30c = max(a,b)print(c)`

2. Print the factorial of any number

`a = 10def fact(n):if (n == 1 or n==0):return 1else:return n*fact(n-1)print(fact(5))or import mathprint(math.factorial(5))`

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

`def yoo(n):if (n%2 == 0):return nnnelse:return n*nprint(yoo(3))print(yoo(2))`

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))```

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 = 0x = numwhile (x >0 ):digit = x%10s = s+(digitdigitdigit)x = x//10print(s)print("Armstrong" if s == num else "Not Armstrong")`

## 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 :)