Correct Verified Answers. Latest 2025-
2026. Graded A
+ - ANS python strings can be "glued" together using the operator:
<< and >> - ANS and operator able to perform bitwise shifts is coded as
1 - ANS what is the value of the i variable when the loop finishes?
>i=0
>while i !=0:
->i=i-1
>else:
->i=i+1
2 - ANSwhat is the output of the following snippet:
>lst = [1,2,3,4]
>lst = lst[-3:-2]
>lst = lst[-1]
>print(lst)
21 - ANSwhat is the output of the following snippet?
>def f(n):
->if n == 1:
->return '1'
1
, ->return str(n) + f(n-1)
>print(f(2))
3 - ANSwhat is the output of the snippet?
>a=2
>if a>0:
->a+=1
>else:
->a-=1
>print(a)
34.23 - ANSwhat is the value of the two literals .3423e2 and 3423e-2
an integer value - ANSpython's built in function named open() tries to open
a file and returns what to identify it?
ch = s.read(1) - ANSyou are going to read just one character from a stream
called s. what statement would you use?
check and execute the source code - ANSa compiler is a program
designed to:
class X: - ANSthe simplest possible class definition in python can be
expressed as:
2