Skip to content

Instantly share code, notes, and snippets.

View Deep18-03's full-sized avatar
🏠
Working from home

Deep18-03

🏠
Working from home
View GitHub Profile
#hotem managemnet system
client_list={1:"harry",2:"carry",3:"danny"}
lock_list={1:"exercise",2:"food"}
import datetime
def gettime():
return datetime.datetime.now()
def lock(op):
for key,value in lock_list.items():
#docstring
def functio1():
"""this is function take two number and sum them"""
num1=1
num2=2
sum=num1+num2
print(sum)
print(functio1.__doc__)
#try except
try:
num1=int(input("enter the number"))
num2=int(input("enter the second number"))
sum=num1+num2
print(sum)
except Exception as e:
print("wrong input")
#Hotel management System
#3 CLIENT name
#total 6 files exercise and food for all three CLIENT
#write a function which takes and retrive the value
import datetime
def gettime():
return datetime.datetime.now()
def take(name):
if name==1:
#Hotel management System
#3 CLIENT name
#total 6 files exercise and food for all three CLIENT
#write a function which takes and retrive the value
import datetime
def gettime():
return datetime.datetime.now()
def take(name):
if name==1:
#opening file using block
with open("deep.txt") as f:
print(f.read())
#seek(),tell()
f=open('deep.txt')
print(f.tell()) #it will tell the pointer of file
print(f.readline())
print(f.tell())
print(f.seek(0)) #it will reset the pointer of file
print(f.readline())
f.close()
#read and write both at same time
f=open("deep.txt","r+")
print(f.read())
f.write("\ndeep here")
f.close()
#If you want to check the numbverr of character in filr use this code
f=open("deep1.txt","a")
a=f.write("\nhow are you")
print(a)
f.close()
#appending new content in file
f=open("deep1.txt","a")
f.write("\nhow are you")
f.close()