python programming

Closed Posted 6 years ago Paid on delivery
Closed Paid on delivery

We have defined our own markup language HRML. In HRML, each element consists of a starting and ending tag, and there are attributes associated with each tag. Only starting tags can have attributes. We can call an attribute by referencing the tag, followed by a tilde, '~' and the name of the attribute. The tags may also be nested.

The opening tags follow the format:

<tag-name attribute1-name = "value1" attribute2-name = "value2" ... >

The closing tags follow the format:

< /tag-name >

For example:

<tag1 value = "HelloWorld">

<tag2 name = "Name1">

</tag2>

</tag1>

The attributes are referenced as:

tag1~value

[login to view URL]~name

You are given the source code in HRML format consisting of N lines. You have to answer Q queries. Each query asks you to print the value of the attribute specified. Print "Not Found!" if there isn't any such attribute.

Input Format

The first line consists of two space separated integers, N and Q. N specifies the number of lines in the HRML source program. Q specifies the number of queries.

The following N lines consist of either an opening tag with zero or more attributes or a closing tag.

Q queries follow. Each query consists of string that references an attribute in the source program.

Constraints:

1 ≤ N ≤ 20

1 ≤ Q ≤ 20

Each line in the source program contains, at max, 200 characters.

Every reference to the attributes in the Q queries contains at max 200 characters.

All tag names are unique.

Output Format

Print the value of the attribute for each query. Print "Not Found!" without quotes if there is no such attribute in the source program.

Sample Input:

4 3

<tag1 value = "HelloWorld">

<tag2 name = "Name1">

</tag2>

</tag1>

[login to view URL]~name

tag1~name

tag1~value

Sample Output:

Name1

Not Found!

HelloWorld

HTML Python XML

Project ID: #14482717

About the project

19 proposals Remote project Active 6 years ago

19 freelancers are bidding on average $38 for this job

schoudhary1553

Greetings sir, i am an expert freelancer for this job and your 100% satisfaction is assured if you allow me to serve. Here is the reason. Why you should pick me? a) I am a very expert and have the same kind of ex More

$100 USD in 2 days
(148 Reviews)
7.3
pkbsdmp

I am a python developer having 6 + experience in IT industry. Relevant Skills and Experience I am expert in: Python XML Parsing, JSON Parsing, web services and Regular Expressions Proposed Milestones $25 USD - NA

$25 USD in 1 day
(102 Reviews)
6.6
anupkelkar02

I am expert in python for Web scraping , API integration , Odoo ERP customization and lexical analysis. Relevant Skills and Experience Also a good hand in web application designing using django and flask. I am a Oracl More

$25 USD in 1 day
(48 Reviews)
6.0
algispetkuns

can do it in next 3 hours Relevant Skills and Experience - python - text processing Proposed Milestones $40 USD - complete program

$40 USD in 1 day
(42 Reviews)
6.0
Webln

Hello! my name is Viktor. We are IT Company «Webin». We provide website design and web and app development services for organizations, public and government institutions, company or private web-pages. We got acquainte More

$34 USD in 2 days
(19 Reviews)
5.6
abhi742

A proposal has not yet been provided

$25 USD in 0 days
(17 Reviews)
4.1
brunogarcianet

I use Python in University, where I study and work. What you need is very simple, and it can be done in a few hours from now. If you hire me now I will do it at this moment, otherwise you will have to wait for me to More

$10 USD in 1 day
(4 Reviews)
3.4
Ahsannazir1

Dear sir/madam I am an undergraduate in computer science having 3 years of experience. My expertise are specially in c,c++,c#, JAVA, Python and android. I can help you with your project and will deliver you quality wor More

$20 USD in 3 days
(3 Reviews)
2.5
wbremer

The bid is for the project as described in the project posting. Relevant Skills and Experience 20 years SW Engineering / Development experience in various languages. Proposed Milestones $30 USD - Delivery of the fina More

$30 USD in 2 days
(1 Review)
2.7
ioriirobertino

Python script. Input: numer_of_lines + number_queries. Output: Queries results. If not attribute, Not Found!. Relevant Skills and Experience 7 years working in linux enviroments. Deep understanding on developing scrip More

$25 USD in 1 day
(0 Reviews)
0.0
n1amr

A proposal has not yet been provided

$25 USD in 2 days
(0 Reviews)
0.0
PhilipTPP

Your project seemed too interesting for me to skip. I was looking for a similar reporting structure to implement at my work myself. Your idea intrigues me. I have written a quick script to test your theory already and More

$15 USD in 1 day
(0 Reviews)
0.0