+ 2

Help me in python coding please

I have 2 text files class1.txt and class 2.txt Content is the following for class1.txt Roll no: 1 Maths actual : 45. Maths pass mark:45 English actual:50 English pass mark:50 Result : Roll no : 2 Maths actual : 45. Maths pass mark:45 English actual:50 English pass mark:50 Result: Class2. txt has following content Roll no: 1 Maths actual : 45 Maths pass mark:45 English actual:50 English pass mark:50 Result : Roll no : 2 Maths actual : 40 Maths pass mark:45 English actual:50 English pass mark:50 Result: Here I have to open these two text files from same folder and then print pass/ fail for each roll number. Fail if mark actual is less than pass mark or else it is pass. How can I solve that in python

4th Nov 2020, 5:17 AM
Dr£@M_c@tcH£r
Dr£@M_c@tcH£r - avatar
2 Answers
+ 2
Try this way : Open file in read write mode and split lines with ':' then until roll no. To roll no, check pass marks <= actual marks then set result to pass else fail.
4th Nov 2020, 1:02 PM
Jayakrishna 🇮🇳
+ 1
create code on your language and link on your code, better remove this topic and create new topic with code , question and link on your code. In code will write comment “what do you want to do”example: input and output
4th Nov 2020, 6:19 AM
Sergey
Sergey - avatar