Generating Python code

2

35 votes
Python, String Algorithms, Algorithms, String, Basics of String Manipulation
Problem

You're given a string s, you should generate a python code which its output is s.
Your score for each test will be:
max(0,(1your code length|s|+9))×10

Notes:

  • |s| is the length of s.
  • Your generated python code cannot use import. the code should use built-in python syntax(check this list).
  • You will get the wrong answer if your generated python code gets any exceptions or errors.
  • Your generated python code's output must be s plus an end of the line. (Refer to the example)
  • You can find tests here. Their order is not the same as a judge.
  • Your generated python code should terminate after at most seconds otherwise, you will get the wrong answer.

Input format

  • The first line contains an integer n.
  • The second line contains a string with length ns which contains 'a'-'z', '#', '.', and '0'-'9' characters.

Output format

Firstly, print the number of your generated python code's lines and then print each code's line.

Constraints

1n1000

Sample Input
6
allall
Sample Output
1
print("all"*2)
Time Limit: 7
Memory Limit: 256
Source Limit:
Explanation

The python code's output is allall.

Editor Image

?