Computer Science, asked by shugu041098, 1 year ago

1. What is the value of x after this sequence of instructions is carried out?

x=0

for i in range(10):

    x=x+1

 a. 10

 b. 11

 c. 12

d.  13



2. What is the correct syntax to take input from user in Python?

 a. x=input()

 b. x-input

 c. x=input_user

 d. input(x)



3. What is the value of a after this sequence of instructions is carried out?

a=0
while(a<10)
  a=a+1

a. 9

b. 10

c. 11

d. 12


4. What is the output of the following snippet if 5 is given as the input?

c=input("Enter a number")
print(c*3)

a. 15

 b. 555

 c. 5

d. 3

5. What is the value of k at the end of the following sequence of instructions?

k=20
x=9
x=x*3
k=x+5

 a. 20

 b. 32

c. 0

 d. 9


6. What is the output of the following code snippet?

a=5
for i in range(10)
a=a+1

 a. 15

 b. 5

 c. 0

 d. Error
 

7. What happens when the following code is executed?

n=5
if(n>1):
print("Hello")

 a. Hello gets printed

 b. Nothing gets printed

 c. An error is thrown

 d. None of the above


8. What is the output of the following snippet?
s=0
for s in range(5):
print(s)

A. 0
1
2
3
4

 B. 0
1
2
3

 C. 01234

 D. 012345


9. What is the value stored in the variable answer at the end of executing the following snippet?
answer=1
n=0
while(n<3):
answer=answer*3
n=n+1

 a. 81

b.  27

 c. 91

 d. 9



10. What happens when the following code is executed?

n=5
if(n%5==0):
print("Hello")

 a. Hello gets printed

b.  Nothing gets printed

 c. Hello gets printed twice

 d. An error is thrown

Answers

Answered by wreckitralph237
0

Hey friend here's your answer:-

1. a

3. a

4. a

5. b

6. a

7. c or a

8. c

9. b

10. d or a

Similar questions