Python Interview Questions Set - 13 Released
Intermediate Level Display numbers divisible by 5 from a list lst_ = list(np.random.randint(10,99,100)) def isDivByFive(num): return (num%5==0) for n in lst_: if isDivByFive(n): print(n, end=",") Create the dictionary with number and its square which is leas then or equal to given number. ur_input = int(input("Enter...
Python Interview Questions Set - 12 Released
Intermediate Level Calculate the multiplication and sum of two numbers a, b = map(int, input("Enter Two Numbers: ").split()) def printSumMulti(num1, num2): print(f"Sum is: {num1 + num2}") print(f"Multiplication is {num1*num2}") printSumMulti(a,b) Print the sum of the current number and the previous number in range ur_input =...
Python Interview Questions Set - 11 Released
Intermediate Level Write the python program to print the numbers in the range without using loops ur_input = int(input("Enter Some Number: ")) def printNums(num): if num > 0: printNums(num-1) print(num) printNums(ur_input) Write the python program to print the numbers in range in descening order without...
Python Interview Questions Set - 10 Released
Intermediate Level Write the python program to Check the occurrence of given character in string ur_input = input("Enter Some String: ") chr_to_check = input("Enter Some Character: ") res = ur_input.count(chr_to_check) Write the python program to print the multiplication table ur_input = int(input("Enter Some Number: "))...
Python Interview Questions Set - 9 Released
Intermediate Level Python Program to Reverse a Number ur_input = int(input("Enter Some Number:")) def reverseNumber(num): if type(num) == str: return int(num[::-1]) else: temp = 0 while num != 0: last_digit = num % 10 temp = temp * 10 + last_digit num //= 10 return...
Python Interview Questions Set - 8 Released
Intermediate Level Sum of Digits Program in Python Aproch 01 ur_input = input("Enter Some Number: ") # return str total_ = 0 for i in ur_input: total_ += int(i) print(total_) Aproch 02 ur_input = int(input("Enter Some Number: ")) # return type is int total_ =...
Python Interview Questions Set - 7 Released
Intermediate Level Importing Required Libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns np.random.seed(42) Python Program to Check Whether a Given Number is Even or Odd using Recursion def checkEvenOdd(num): if num < 2: return (num%2 ==...
Python Interview Questions Set - 6 Released
Intermediate Level Is Python case sensitive when dealing with identifiers? Yes. Python is case-sensitive when dealing with identifiers. It is a case sensitive language. Thus, variable and Variable would not be the same. How to create a new column in pandas by using values from...
Python Interview Questions Set - 5 Released
Intermediate Level What is __init__ in Python? _init_ methodology is a reserved method in Python aka constructor in OOP. When an object is created from a class and _init_ methodology is called to access the class attributes. What are the tools present to perform static...
Python Interview Questions Set - 4 Released
Intermediate Level What are comments and how can you add comments in Python? Comments in Python refer to a piece of text intended for information. It is especially relevant when more than one person works on a set of codes. It can be used to...
Recent Comments
Archives
Categories
Categories
- Inspiration (1)
- Style (1)
- Technical Blog (30)
- Tips & tricks (2)
- Uncategorized (25)