- Overlapping sub-problems
- optimal substructure
Here is a code which may help you to understand what I am trying to say
Code:
def DPfact(N): arr={} if N in arr: return arr[N] elif N
def DPfact(N): arr={} if N in arr: return arr[N] elif N
import pickle a = {'HR':'Human Resource','FIN':'Finance','LG':'Legal'} with open('filename.pickle', 'wb') as handle: pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL) #Now you will have this file, take this to your PC , save it in same #folder as Jupiter notebook you are working in
print("Name".center(12," "),"Age".center(12," "),"Years".center(12," "),"Salary".center(12, " ")) #employee=[["hello","23","3","sal"],["hello","23","3","sal"]] for emp in
print("Welcome {}, have a nice day!! ".format(input()))
name=input() print("Welcome {}, have a nice day!! ".format(name))
python "name of python file".py
class student: def getStudent(self): self.name = input("Name: ") self.Roll = int(input("Roll: ")) class test(student): def getMarks(self): print("Enter the marks of the respective subjects") self.literature = int(input("Literature: ")) self.math = int(input("Math: "))
sudo apt install python3-pip
pip3 --version
Leave a comment: