forked from aashutoshrathi/Testcase-Generator
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPythonExamples.txt
More file actions
39 lines (31 loc) · 1.06 KB
/
PythonExamples.txt
File metadata and controls
39 lines (31 loc) · 1.06 KB
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
29
30
31
32
33
34
35
36
37
38
39
# THE PYTHON CODE CONVERTS WHATEVER YOU PRINT AS TEST-CASES
1. Taking a random input from the user:
N = RINT(1,1000) # Between 1 and 1000
print(N)
2. Take two inputs from the user.
print(RINT(1,1000), RINT(1,1000))
3. Take an input N and N inputs from the user.
n = RINT(1,1000)
print(n)
for i in range(n):
print(RINT(1,1000), end=' ')
4. Take an input string.
string = 'abcdefghijklmnopqrstuvwxyz'
for i in range(RINT(1,1000)):
print(string[RINT(0,25)], end='')
5. Take an input T(testcases) and take another input N and take N inputs from the user.
T = RINT(1,1000)
print(T)
for i in range(T):
N = RINT(1,1000)
print(N)
for j in range(N):
print(RINT(1,1000), end=' ')
print()
6. Take an input binary value.
for i in range(RINT(1,100)):
print(RINT(0,1),end='')
# BASIC GUIDELINES
1. LOGIC FILE CLASS MUST ALWAYS BE logic.
2. For C & C++ language, main must be int.
3. A general suggestion is to print between 1 to 10^5 for numbers between testcases. Small cases repeating t number of times is better than printing a lot of testcases.