fname3 = input("Enter the Blue print name: ")
import re
with open (fname3) as file:
fileText=file.read()
q1,q2,q3 = [ int(n) for n in re.findall(": (\d+)",fileText) ]
p1,p2,p3 = re.findall("(.*):",fileText)
qb=q1+q2
qc=q1+q2+q3
print("This BLUEPRINT CONTAINS--------------|")
print(p1+" Questions: "+q1)
This code above is giving an error of line: print(p1+" Questions: "+q1)
but print(p1+" Questions: "+p1)
is giving correct output abd also print("q1")
but combining them is outputting an error
but gives error print("questions: "+q1)
This code opens a txt file which contains the following:
Part A: 12 10*2 = 20
Part B: 6 4*5 = 20
Part C: 5 3*10 = 30