python questions.

Question1- what is monkey patching?

Question2- What is context manager?

Question3- How django work from user prospective?

Question4- Middle server/application before Django server?

Question5- What is closure function in python?

Question6-What is Middleware in django?

Question7- In lambda function can be return more than 1 value , if then how we can do?

Question8- What is non-local variable in python hint-used in decorator?

Question9- How to get directory, its files, its subdirectories and its subdirectories files without using os.walk()predefine function.

Question10- Simple python program for below problem statement

input_str = aabbbbcccaa
output_str — a2b4c3a2

1- Install Python 3.x version into the system.
Download python 3.x by visiting the below link :-

2- Download & Install anaconda by visiting below web link.

we can escape anaconda but for better python installation suggested to install Anaconda.

Now installed the required python module to run ic.py & bc.py python files.

godas_to_roms files can be download by visiting below github link

The companies are:

  1. Tower Research LLC : This algorithmic trading company is insanely tough to get into but pays the most in India.The starting salary is 40lpa + most of which is inhand and I am not even including the bonus that Quants make.
  2. Rubrik
  3. Codenation
  4. De Shaw.
  5. World Quant LLC.
#%d%s%f
print(“%d is the integer form of %.2f and the string %s”%(12,12.07666,”pythonstr”))
#second type of print form
print(“{} is the integer form of {} and the string {}”.format(12,12.07666,”pythonstr”))
#third type of print form(Reodering)
print(“{1} is the integer form of {0} and the string {2}”.format(12,12.07666,”pythonstr”))
#Fourth type of print form(Reodering with keyword)
print(“{a} is the integer form of {b} and the string {c}”.format(c=12,a=12.07666,b=”pythonstr”))

Different between Dictionary and DefaultDictionary.

Dictionary is direct data type in python, whereas Defaultdictionary is a function in collections module.

If the key / item not present in dictionary then we get Error message whereas in case of defaultdictionary we will not get error instead we will get the default assigned value only thing is we have to define while creating defaultdictionary variable.

#dictinary and defaultdictnormaldictionary=dict()
print(type(normaldictionary))
#print(normaldictionary[“keynotexisit”])
#Above normal dictionary give an error as key not present
from collections import defaultdict
defaultdict1=defaultdict()
print(type(defaultdict1))
#print(defaultdict1[‘keynotexisit’])
######################################
from collections import defaultdict
default2=defaultdict(int)
print(default2[‘keynotexist’])

#Execute the above code all thing will be clear.

Thank you.

Schema is a python library which is used to validate python structure .
Basically to check whether we are providing/assigning correct data type or not.

for using schema we have to install the schema library.

!pip install schema pip install schema

now create schema

from schema import Schemaschema=Schema([‘name’:(str)])data1=([{‘name’:”msatutorpy@gmail.com”}])print(schema.is_valid(data1))#output — Truedata2=([{‘name’:67}])print(schema.is_valid(data2))#output — False

#The output show which value we can accept as str / string value .
data1 variable is in correct schema format, whereas data2 is in not schema function as we are providing integer in place of string.

# Collections are the inbuilt module in python

#which give more functionalites and features than inbuilt data types — list, set, dictionary,tuple etc.

#For using collections you have to import collections module

#Few the popular collections functions.

Counter

defaultdict

OrderedDict

deque

ChainMap

namedtuple()

#Counter function of Collections module

#counter function…

Insha.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store