summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRishi-k-s <rishikrishna.sr@gmail.com>2023-03-22 21:22:29 +0530
committerRishi-k-s <rishikrishna.sr@gmail.com>2023-03-22 21:22:29 +0530
commitdc438a57c4fd7f1cc3857a09757e05e296df24cb (patch)
tree6b32df29a347a64f1b093ef49a138a72aa075216
parent6b50a161bf0312bdce350e03872ac1842c9f7321 (diff)
-rw-r--r--PLANTS.datbin142 -> 33 bytes
-rw-r--r--boardexams.py76
2 files changed, 44 insertions, 32 deletions
diff --git a/PLANTS.dat b/PLANTS.dat
index 771f924..0c32284 100644
--- a/PLANTS.dat
+++ b/PLANTS.dat
Binary files differ
diff --git a/boardexams.py b/boardexams.py
index 7e1d857..fa2ba09 100644
--- a/boardexams.py
+++ b/boardexams.py
@@ -62,37 +62,38 @@
# return counter
# print(Count_Line())
-# import pickle
-# def WRITERED():
-# fp_w = open("PLANTS.dat","ab")
-# id = input("Enter ID: ")
-# nm = input("Enter Name: ")
-# pr = input("Enter Price: ")
-# userList = [id,nm,pr]
-# pickle.dump(userList,fp_w)
-# fp_w.close()
-
-# def SHOWHIGH():
-# fp_r = open("PLANTS.dat","rb")
-# while True:
-# try:
-# x = pickle.load(fp_r)
-# print(x)
-# except EOFError:
-# break
+import pickle
+def WRITERED():
+ fp_w = open("PLANTS.dat","wb")
+ id = input("Enter ID: ")
+ nm = input("Enter Name: ")
+ pr = input("Enter Price: ")
+ userList = [id,nm,pr]
+ pickle.dump(userList,fp_w)
+ fp_w.close()
+
+def SHOWHIGH():
+ fp_r = open("PLANTS.dat","rb")
+ while True:
+ try:
+ x = pickle.load(fp_r)
+ if(int(x[0]) > 23):
+ print(x)
+ except EOFError:
+ break
-# fp_r.close()
+ fp_r.close()
-# menu = True
+menu = True
-# while menu:
-# x = int(input("-->"))
-# if(x == 1):
-# WRITERED()
-# elif(x == 2):
-# SHOWHIGH()
-# else:
-# menu = False
+while menu:
+ x = int(input("-->"))
+ if(x == 1):
+ WRITERED()
+ elif(x == 2):
+ SHOWHIGH()
+ else:
+ menu = False
# x = "Sreeejesh is beactyful"
# x= x.split()
@@ -115,7 +116,18 @@
# for K in range(FROM,TO+1):
# print(AR[K],end="#")
-a= []
-p = str(a)
-k = int(a)
-print(k) \ No newline at end of file
+# a= []
+# p = str(a)
+# k = int(a)
+# print(k)
+
+
+# mainStack = []
+
+# getStr = input("Enter a string: ")
+# for eachWord in getStr:
+# mainStack.append(eachWord)
+
+# for i in range (len(mainStack)-1,-1,-1):
+# print(mainStack[i],end=" ")
+