Friday 16 August 2019

The Joy of Computing using Python- Quiz Assignment 2

Sorry for last time wrong answer for Question 2. Just overlooked the question. Even I did the same mistake.

If you sense any wrong answer, comment below so that i can verify again and give the correct one. Knowledge improves by sharing. 
This time  100% correct answers. Thank you......

1. In Python, a variable must be declared before it is assigned a value.

 
 

2. What is the output of the following program?
     for i in range(2): 
print(i,end="") 

     for i in range(4,6): 
print(i,end="" )

 
 
 
 

3. What is the output if the following code snippet?
     a=4.5
     b=15
     print(a+b)
 
 
 
 

4. What is the output of the following program?
     i = 1
     while True: 
if i%3 == 0: 
break
print(i,end="") 
i + = 1

 
 
 
 
      Ans: d
5.   i = 2
      while True:
      if i%3 == 0:
        break
    print(i,end="")
    i += 2
 
 
 
 

6. Which of the following is correct variable name in Python?
 
 
 
 

7. What is the output of this expression in Python, 3*1**3?
 
 
 
 
      Ans: a
8.  State True or False.
     Python is a case-sensitive language.
 
 
     Ans: True
9. Which of the following is not a keyword in Python?
 
 
 
 
      Ans: add
10. What would be the value of variable y if the following set of instructions are executed?
       x=4.5
       y=int(x)
 
 
 
 

19 comments:

  1. Replies
    1. Sorry cant provide answers for that. None of us registered to that course. Thank you

      Delete
  2. iot 2019 week 2 and week3 answers plese

    ReplyDelete