PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Getting Multiline Input...
line = ""
lines = list()
while True:
try:
line = input()
except:
break
lines.append(line)
# Handling Input...
lines = "\n".join(lines)[::-1].rstrip()[::-1].split("\n")
if line == "" or lines[0].casefold().startswith("input".casefold()):
lines = ['raise Exception("Invalid Input!")', 'INPUT NONE'.casefold()]
if len(lines) == 1 and lines[0].startswith("#"):
lines = ['print("' + lines[0][1:] + '")']
if len(lines) >= 1 and not(lines[-1].casefold().startswith("input".casefold())):
lines.append("INPUT NONE".casefold())
a = [lines.pop(), "\n".join(lines)]
a[0] = " ".join(a[0].split(" ")[1:])
# Handling input Python3 Program...
b = list()
b.append("try:")
b.append(" " + "\n ".join(lines))
b.append("except:")
b.append(" " + "print('You are supposed to give a valid \"Python3 Program\", \"Its Input\" (optional) without any trailing newlines, tabs, blankspaces as input!')")
b.append("print('')\n" + "print('SAMPLE INPUT TO PYNCEPTION (Python + Inception):')\n" + "print(':Syntax:')\n" + "print('your_python3_program')\n" + "print('INPUT command_line_arguments')\n" + "print(':Example:')\n" + "print('print(sys.argv[1])')\n" + "print('INPUT 5 9')")
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run