python programming

已关闭 已发布的 6 年前 货到付款
已关闭 货到付款

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

项目ID: #14482717

关于项目

19个方案 远程项目 活跃的6 年前

有19名威客正在参与此工作的竞标,均价$38/小时

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 更多

$100 USD 在2天内
(148条评论)
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

$25USD 在1天里
(102条评论)
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 更多

$25USD 在1天里
(48条评论)
6.0
algispetkuns

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

$40USD 在1天里
(42条评论)
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 更多

$34 USD 在2天内
(19条评论)
5.6
abhi742

A proposal has not yet been provided

$25 USD 在0天内
(17条评论)
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 更多

$10USD 在1天里
(4条评论)
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 更多

$20 USD 在3天内
(3条评论)
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 更多

$30 USD 在2天内
(1条评论)
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 更多

$25USD 在1天里
(0条评论)
0.0
n1amr

A proposal has not yet been provided

$25 USD 在2天内
(0条评论)
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 更多

$15USD 在1天里
(0条评论)
0.0