JOCPython 2023 S2 Question Bank
JOCPython 2023 S2 Question Bank
a) QDSFA
b) ACIED
c) HEAIS
d) ECEYW
a) repeat
b) repeat until
c) forever
d) forever until
a) Event
b) Sensing
c) Control
d) Operators
a) Hide
b) Delete
c) Move
d) Walk
10
a) Show
b) Hide
c) Delete
d) Move
12
a) py
b) se
c) sb
d) sc
14
a) 0
b) 100
c) 20
d) None of the above
16
18
a) ever
b) forever
c) never
d) None of the above
20
22
a) Move 10 steps
b) Move -10 steps
c) Both 1 and 2
d) Neither 1 and 2
24
26
Ans: 40
28
Ans: 22
30
32
Ans: Table of 5 34
Ans: Table of 5 4
a) Abc
b) Abd23
c) 32asd
d) Ab_cd_23
a) Earth is round
Moon has lots of dust.
b) Earth is
round
Moon has lots of dust.
c) Earth is round. Moon has lots of dust. 11
L = [[1,2,3],[0,4,5],[0,0,6]]
for i in range(3):
for j in range(2,i-1,-1):
print(L[i][j], end=“”)
a) 3,2,1,5,4,6
b) 321546
c) 0,0,0,0,0,0
d) 000000
13
15
a) [0,1,2] (5,3,4)
b) [0,1,2] (5,)
c) [0] (5,3,4)
d) [0] (5,)
17
a) Earth is round
Moon has lots of dust.
b) Earth is
round
Moon has lots of dust.
c) Earth is round. Moon has lots of dust. 5
a) Push
b) Write
c) Insert
d) All of the above
a) Push
b) Write
c) Insert
d) All of the above
a) Number of
b) Total
c) Count
d) Length
10
12
14
a) [2, 3, 5]
b) [0, 1, 1]
c) [1, 2, 3]
d) None of the above
16
a) 0
b) 1
c) 2
d) This code will raise a runtime error
18
Ans: 1
20
a) False True
b) True False
c) True True
d) False False
22
a) count=50
b) The following code throws up an error.
c) count=550
d) count=450
24
26
L = [[1,2,3],[0,4,5],[0,0,6]]
for i in range(3):
for j in range(2,i-1,-1):
print(L[i][j], end=“”)
a) 3,2,1,5,4,6
b) 321546
c) 0,0,0,0,0,0
d) 000000
28
a) 26
b) 676
c) 17576
d) 456976
a) Push
b) Write
c) Insert
d) All of the above
a) Number of
b) Total
c) Count
d) Length
10
12
14
a) [2, 3, 5]
b) [0, 1, 1]
c) [1, 2, 3]
d) None of the above
16
a) 0
b) 1
c) 2
d) This code will raise a runtime error
18
Ans: 1
20
a) False True
b) True False
c) True True
d) False False
22
a) count=50
b) The following code throws up an error.
c) count=550
d) count=450
24
26
L = [[1,2,3],[0,4,5],[0,0,6]]
for i in range(3):
for j in range(2,i-1,-1):
print(L[i][j], end=“”)
a) 3,2,1,5,4,6
b) 321546
c) 0,0,0,0,0,0
d) 000000
28
a) 26
b) 676
c) 17576
d) 456976
a) Push
b) Write
c) Insert
d) All of the above
a) Number of
b) Total
c) count
d) Length
10
12
14
a) [2, 3, 5]
b) [0, 1, 1]
c) [1, 2, 3]
d) None of the above
16
a) 0
b) 1
c) 2
d) This code will raise a runtime error
18
Ans: 1
20
a) False True
b) True False
c) True True
d) False False
22
a) count=50
b) The following code throws up an error.
c) count=550
d) count=450
24
26
L = [[1,2,3],[0,4,5],[0,0,6]]
for i in range(3):
for j in range(2,i-1,-1):
print(L[i][j], end=“”)
a) 3,2,1,5,4,6
b) 321546
c) 0,0,0,0,0,0
d) 000000
28
a) Sorted list
b) Unsorted list
c) Both A and B
d) Any list with any elements
30
a) Wav
b) Wave
c) Wv
d) Waves
32
a) SpeechRecognition
b) text_to_speech
c) speech_to_text
d) text_translate
34
a) True
b) False
36
38
a) d.key()
b) d.item()
c) d.value()
d) d.keys()
40
42
a) KeyError
b) IndexError
c) RunTimeError
d) ValueError
44
46
a) EJBNPOE
b) FKCORPF
c) HMERTSH
d) HMEQSRH
a) random.choices(L)
b) random.select(L)
c) random.movie(L)
d) random.random(L)
11
a) 0
b) 1
c) 2
d) 3
13
a) Commas
b) Colons
c) Semi-colons
d) Slash
17
19
21
a) 1 2 3 4 5 6 12 18 17 16 15 14 13 7 8 9 10 11
b) 1 2 3 4 5 6 12 18 17 16 15 14 13
c) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
d) 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
a) turtle.back(distance)
b) turtle.bk(distance)
c) turtle.backward(distance)
d) All of the above
11
a) gmplot
b) csv
c) both
d) None
13
a) 4
b) 5
c) 6
d) 7
15
17
a) single quotes
b) double quotes
c) triple quotes
d) only A and B
e) A, B and C
a) invalid syntax
b) tuple index out of range
c) prints nothing
d) madan
11
a) Web scraping
b) Machine learning
c) Natural language processing
d) Image processing
13
15
17
a) nltk.corpus
b) nltk.sentiment
c) nltk.tokenize
d) nltk.stem
19
21
a) nltk.sentiment
b) nltk.remove_stopwords
c) nltk.corpus.stopwords
d) nltk.tokenize
23
a) nltk.stem
b) nltk.wordnet
c) nltk.tokenize
d) nltk.corpus
25
a) nltk.sentiment
b) nltk.parse
c) nltk.chunk
d) nltk.ner
27
a) nltk.corpus
b) nltk.tokenize
c) nltk.sentiment
d) nltk.pos_tag
29
31
33
a) List
b) Tuple
c) Dictionary
d) NumPy array
35
a) pillow.open
b) pillow.process
c) pillow.image
d) PIL
37
a) resize()
b) scale()
c) change_size()
d) reshape()
39
41
a) JPEG
b) PNG
c) GIF
d) BMP
43
a) getpixel()
b) RBGvalue()
c) pixelValue()
d) none of the above
45
a) grayscale()
b) convert_to_grayscale()
c) convert()
d) filter()
47
a) By matching handwriting.
b) By analyzing word length distribution with previous books.
c) By analyzing the number of pages in a book.
d) By analyzing the book’s preface.
10
12
a) Graph = nx.gnp_random_graph(25,0.5)
b) Graph = nx.gnp_random_graph(25,1.0)
c) Graph = nx.gnp_random_graph(25,0.25)
d) Graph = nx.gnp_random_graph(25,0.75)
14
16
a) True
b) False
c) It will return neither True nor False
d) It will throw an error
18
a) 1
b) 2
c) 3
d) 4
20
22
24
26
a. str
b. string
c. text
d. textutils
10
a. capitalize()
b. title()
c. upper()
d. capwords()
12
a. islower()
b. isalpha()
c. isdigit()
d. islowercase()
14
a. string.random_password()
b. random.choice(string.ascii_letters)
c. random_password(string.ascii_letters)
d. string.generate_password()
16
18
a. string.format()
b. string.replace()
c. string.Template()
d. string.substitute()
20
a. "Hello, World!"
b. "Hello World"
c. "Hello"
d. "World"
22
a) Kadane's problem
b) Josephus problem
c) Conjecture Collatz
d) Dijkstra Problem
24
a. Web scraping
b. Web testing and automation
c. Data analysis
d. File manipulation
a. find_element_by_tag_name()
b. find_element_by_id()
c. find_element_by_class_name()
d. find_element_by_name()
11
13
a. click_element()
b. simulate_click()
c. click()
d. interact()
15
a. driver.quit()
b. driver.close()
c. driver.exit()
d. driver.stop()
17
20
a. Mathematical calculations
b. Date and time manipulation
c. File input and output
d. Network communications
22
a. date
b. time
c. datetime
d. timestamp
24
a. datetime.now()
b. datetime.today()
c. datetime.current()
d. datetime.current_time()
26
28
a. set_timezone()
b. convert_timezone()
c. localize()
d. timezone()
30
a. Mathematical calculations
b. Date and time manipulation
c. Working with graphical user interfaces (GUIs)
d. Creating and formatting calendars
32
a. calendar.monthrange(year, month)
b. calendar.month_days(year, month)
c. calendar.days(month, year)
d. calendar.get_month_days(year, month)
34
a. Text summarization
b. Document retrieval
c. Web page ranking
d. Image recognition
10
12
a. n / 2
b. n - 1
c. 2n
d. 3n + 1
14
16