diff --git a/Day-11/test.py b/Day-11/test.py new file mode 100644 index 00000000..149200a6 --- /dev/null +++ b/Day-11/test.py @@ -0,0 +1,17 @@ +student_properties= { + "name":"abhi", + "class":"12th" +} + +students_info=[ + { + "name":"nishka", + "class":"12th" +}, + { + "name":"kiyana", + "class":"12th" +}] + +print (student_properties ["name"]) +print (students_info[0]["name"]) \ No newline at end of file diff --git a/Day-12/fileoperations.py b/Day-12/fileoperations.py new file mode 100644 index 00000000..2fa7ea50 --- /dev/null +++ b/Day-12/fileoperations.py @@ -0,0 +1,13 @@ +def updatefileProperties (filePath,key,value): + with open(filePath,"r") as serverConf: + lines = serverConf.readlines(); + + with open(filePath,"w") as serverConf: + for line in lines: + if key in line: + serverConf.write(key+"="+value+"\n") + else: + serverConf.write(line) + + +updatefileProperties("server.conf","MAX_CONNECTIONS","200") \ No newline at end of file