Dict Practice 3


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Python3

In this task, you will need to generate some code.

You have obtained an Old-to-Modern English dictionary that you want to use in a python programme. The linguist in charge wants you to write a script to transform this dictionary to a python script file.

Input Specification

The first line will contain a single integer \(N\) (\(1 < N < 100\)), which is the number of entries.

The next \(N\) lines will each contain two words: the old Enlgish word, and its modern translation.

Output Specification

The first line will contain the following text:

lex = {

For the next \(N\) lines, each line will contain a key and value pair enclosed in double quote as well as ending with a comma. Here's an example:

    "keyys": "keys",

The final line should be a single right curly bracket.

}

The point is, the output here should be valid python code, that you can copy into any python script and use.

Sample Input 1

10
vs us
centinels sentinels
liue live
vpon upon
houre hour
strook struck
twelue twelve
releefe relief
thankes thanks
sicke sick

Sample Output 1

lex = {
    "vs": "us",
    "centinels": "sentinels",
    "liue": "live",
    "vpon": "upon",
    "houre": "hour",
    "strook": "struck",
    "twelue": "twelve",
    "releefe": "relief",
    "thankes": "thanks",
    "sicke": "sick",
}

Comments

There are no comments at the moment.