wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Round 1 (Tech Utsav)

Total questions: 15

Worksheet time: 75secs

Name
Class
Date
1.

def rotLeft(a, d):

d %= len(a)

return a[d:] + a[:d]

The input is:

a = [1, 2, 3, 4, 5]

d = 2

a)

[3, 4, 5, 1, 2]

b)

[1, 2, 3, 4, 5]

c)

[4, 5, 1, 2, 3]

d)

[5, 1, 2, 3, 4]

2.

The tolerance bands: gold; silver; brown, represent:

a)

10%, 5%, 1%

b)

5%, 10%, 2%

c)

5%, 10%, 1%

d)

10%,   5%,   2%

3.

def calculate(n):

result = [ ]

for i in range(1, n + 1):

if i % 2 == 0:

result.append(i ** 2)

else:

result.append(i ** 3)

return result

n = 5

output = calculate(n)

print(output)

Input is :

n =5

a)

[1, 4, 9, 16, 25]

b)

[1, 2, 3, 4, 5]

c)

[1, 4, 27, 16, 125]

d)

[1, 8, 27, 64, 125]

4.

Name the three leads of a common transistor

a)

Collector Bias Omitter

b)

Emitter Collector Bias

c)

Base Collector Case

d)

Collector Base Emitter

5.

Which of the following is a type of error associated with digital-to-analog converters (DACs)?

a)

nonmonotonic error

b)

incorrect output codes

c)

offset error

d)

nonmonotonic and offset error

6.

def is_full_of_colors(seq):

red, green, yellow, blue = 0, 0, 0, 0

for i, c in enumerate(seq):

if c == 'R': red += 1

elif c == 'G': green += 1

elif c == 'Y': yellow += 1

elif c == 'B': blue += 1

if abs(red - green) > 1 or abs(yellow - blue) > 1: return False

return red == green and yellow == blue

T = int(input())

for _ in range(T):

print(is_full_of_colors(input().strip()))

The inputs are :

T = 3

Test Cases:

1. "RGRGRB"

2. "RGBY"

3. "RRGGBB"

a)

True

True

False

b)

False

True

True

c)

True

False

False

d)

True

False

True

7.

Guess the next number

230 460 46 92 9.2 .......

a)

18.4

b)

18

c)

18.2

d)

20.4

8.

def highestValuePalindrome(s, n, k):

s, changes = list(s), [0] * n

for l, r in zip(range(n // 2), range(n - 1, n // 2 - 1, -1)):

if s[l] != s[r]:

if k == 0: return "-1"

s[l] = s[r] = max(s[l], s[r])

k, changes[l] = k - 1, 1

for l, r in zip(range(n // 2), range(n - 1, n // 2 - 1, -1)):

if k <= 0: break

if s[l] != '9':

if changes[l]: k -= 1

elif k >= 2: k -= 2

s[l] = s[r] = '9'

if k > 0 and n % 2: s[n // 2] = '9'

return "".join(s)

The inputs are:
s = "3943"

n = 4

k = 1

a)

3943

b)

-1

c)

9999

d)

3993

9.

What is the symbol for an inductor in a circuit diagram?

a)

A straight line

b)

A zig-zag line

c)

A series of loops or coils

d)

A triangle

10.

def countSwaps(a):

numSwaps = 0

n = len(a)

for i in range(n):

for j in range(n - 1):

if a[j] > a[j + 1]:

a[j], a[j + 1] = a[j + 1], a[j]

numSwaps += 1

print(f"Array is sorted in {numSwaps} swaps.")

print(f"First Element: {a[0]}")

print(f"Last Element: {a[-1]}")

The inputs are:
a = [3, 2, 1]

a)

Array is sorted in 3 swaps.

First Element: 1

Last Element: 2

b)

Array is sorted in 2 swaps.

First Element: 1

Last Element: 3

c)

Array is sorted in 3 swaps.

First Element: 1

Last Element: 3

d)

Array is sorted in 1 swap.

First Element: 1

Last Element: 3

11.

A diode allows current to flow in:

a)

Both directions

b)

Only the forward direction

c)

Only the reverse direction

d)

None of the above

12.

from statistics import mean, median, mode

def calculate_stats(arr):

print(round(mean(arr), 1))

print(round(median(arr), 1))

print(min(sorted([x for x in set(arr) if arr.count(x) == max(arr.count(y) for y in arr)])))

n = int(input())

arr = list(map(int, input().split()))

calculate_stats(arr)

The inputs are:
5

1 3 3 3 2

a)

2.4

3.0

3

b)

3.0

2.0

2

c)

2.6

3.0

3

d)

2.4

2.0

3

13.

A logic circuit whose output is LOW when at least one input is HIGH is a(n) _________ gate.

a)

NOR

b)

AND

c)

NAND

d)

Exclusive OR-Gate

14.

def inOrder(root):

if root:

inOrder(root.left)

print(root.data, end=" ")

inOrder(root.right)

The inputs are:
1

2 3

4 5

a)

4 5 2 3 1

b)

5 4 2 3 1

c)

4 2 5 1 3

d)

1 2 3 4 5

15.

NAND circuits IC No?

a)

7408

b)

7400

c)

7432

d)

7402