Quiz 2
Registry Synced

May 2026 - Python - Week 1 - Week 1 Graded Assignment 1

1760 words
9 min read

Week 1 Graded Assignment 1

Course: May 2026 - Python
Week 1 Graded Assignment 1 WEEK 1 Due Jun 28, 2026 11:59 PM IST Overdue

Introduction

Week 1 Graded Assignment 1Week 1
28th Jun

Week 1 Graded Assignment 1

Week 1
Due Jun 28, 202611:59 PM ISTOverdue

Question 1 / 29

1 mark
What will be the output type of the expression 5 + 2?
Answer is Correct Score: 1 / 1
Options:
  • A. int ✅
  • B. float
  • C. str
  • D. bool
  • E. Invalid Expression (raises an error)

Question 2 / 29

1 mark
What will be the output type of the expression 5 + 2.0?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float ✅
  • C. str
  • D. bool
  • E. Invalid Expression (raises an error)

Question 3 / 29

1 mark
What will be the output type of the expression 5 ** 2?
Answer is Correct Score: 1 / 1
Options:
  • A. int ✅
  • B. float
  • C. str
  • D. bool
  • E. Invalid Expression (raises an error)

Question 4 / 29

1 mark
What will be the output type of the expression 5.0 * 2?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float ✅
  • C. str
  • D. bool
  • E. Invalid Expression (raises an error)

Question 5 / 29

1 mark
What will be the output type of the expression '5' + "2"?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float
  • C. str ✅
  • D. bool
  • E. Invalid Expression (raises an error)

Question 6 / 29

1 mark
What will be the output type of the expression '5' > 2?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float
  • C. str
  • D. bool
  • E. Invalid Expression (raises an error) ✅

Question 7 / 29

1 mark
What will be the output type of the expression 5 == 5 and "2"?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float
  • C. str ✅
  • D. bool
  • E. Invalid Expression (raises an error)

Question 8 / 29

1 mark
What will be the output type of the expression "555"[::2]?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float
  • C. str ✅
  • D. bool
  • E. Invalid Expression (raises an error)

Question 9 / 29

1 mark
What will be the output type of the expression "555"["2"]?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float
  • C. str
  • D. bool
  • E. Invalid Expression (raises an error) ✅

Question 10 / 29

1 mark
What will be the output type of the expression "555["2"]"?
Answer is Wrong Score: 0 / 1
Options:
  • A. int
  • B. float
  • C. str ❌ (your answer)
  • D. bool
  • E. Invalid Expression (raises an error)

Question 11 / 29

1 mark
What will be the output type of the expression False?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float
  • C. str
  • D. bool ✅
  • E. NoneType

Question 12 / 29

1 mark
What will be the output type of the expression int("5.0") + float(2)?
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float
  • C. str
  • D. bool
  • E. Raises an error ✅

Question 13 / 29

1 mark
What is the type of the following expression?
1 + 4 / 2
Answer is Correct Score: 1 / 1
Options:
  • A. int
  • B. float ✅
  • C. str
  • D. bool
  • E. Invalid Expression (raises error)

Question 14 / 29

2 marks
Select the expression(s) that are equivalent to the given expression.
(1 + 2) * (3 + 4)
Answer is Correct Score: 2 / 2
Options:
  • A. (1 + (2 * (3 + 4)))
  • B. (1 + 2) * 3 + 4
  • C. ((1 + 2) * (3 + 4)) ✅
  • D. 1 + (2 * 3) + 4

Question 15 / 29

2 marks
Select the expression(s) that are equivalent to the given expression.
'a' + 'b' * 2 + 'c'
Answer is Correct Score: 2 / 2
Options:
  • A. (('a' + 'b') * 2) + 'c'
  • B. ('a' + ('b' * 2)) + 'c' ✅
  • C. 'a' + (('b' * 2) + 'c') ✅
  • D. ('a' + 'b') * (2 + 'c')

Question 16 / 29

2 marks
Select the expression(s) that are equivalent to the given expression.
a == b > c
Answer is Correct Score: 2 / 2
Options:
  • A. (a == b) > c
  • B. a == (b > c)
  • C. (a == b) and (b > c) ✅
  • D. (a == b) or (b > c)

Question 17 / 29

2 marks
Select the expression(s) that are equivalent to the given expression.
a == b > c == d
Answer is Correct Score: 2 / 2
Options:
  • A. (a == b) > (c == d)
  • B. a == (b > (c == d))
  • C. (a == b) and (b > c) and (c == d) ✅
  • D. (a == (b > c)) and ((b > c) == d)

Question 18 / 29

2 marks
Select the expression(s) that are equivalent to the given expression.
a and not b or not c
Answer is Correct Score: 2 / 2
Options:
  • A. (a and (not b)) or (not c) ✅
  • B. (a and not b) or (not c) ✅
  • C. a and (not (b or not c))
  • D. a and ((not b) or (not c))

Question 19 / 29

2 marks
How does the Python interpreter parenthesize the following expression?
8.2 * 10 ** 4 + 19
Answer is Correct Score: 2 / 2
Options:
  • A. ((8.2 * 10) ** 4) + 19
  • B. 8.2 * (10 ** (4 + 19))
  • C. (8.2 * (10 ** 4)) + 19 ✅
  • D. (8.2 * 10) ** (4 + 19)

Question 20 / 29

2 marks
Select the correct statement(s) about print in python.
Answer is Correct Score: 2 / 2
Options:
  • A. print prints new line character at the end of the line. ✅
  • B. print is a built-in function. ✅
  • C. In a python REPL/Notebook print("hi") will give same output as just "hi".
  • D. print can be used to disply any data type. ✅

Question 21 / 29

2 marks
Select the correct statement(s) about input in python.
Answer is Correct Score: 2 / 2
Options:
  • A. Output type can be passed to input as input(type) to get output in the required type.
  • B. input accepts atmost one argument. ✅
  • C. input is a built-in function. ✅
  • D. input can be only used in python scripts and not in REPL/Notebook.

Question 22 / 29

1 mark
Common data for the next 3 questions
This set of questions is intended for you to practice python tutor and get used to it. Watch this tutorial on how to use python tutor before attempting this questions.
Consider the code present in this python tutor link.
Answer the following questions by using the python tutor interface.
What is the value of a after executing line 3, using the input already given?
Your Answer: (Not answered)

Question 23 / 29

1 mark
What is the value of a after executing line 4, if input given changed to 13?
Your Answer: (Not answered)

Question 24 / 29

1 mark
What is the value of a after executing line 5, if the input is changed to 8?
Your Answer: (Not answered)

Question 25 / 29

1 mark
Common data for the next 3 questions
This set of questions is intended for you to practice python tutor and get used to it. Watch this tutorial on how to use python tutor before attempting this questions.
Consider the code present in this python tutor link.
Answer the following questions by using the python tutor interface.
What is the value of a after executing line 3, using the input already given?
Your Answer: (Not answered)

Question 26 / 29

1 mark
What is the value of a after executing line 4, if input given changed to 12?
Your Answer: (Not answered)

Question 27 / 29

1 mark
What is the value of a after executing line 5, if the input is changed to 7?
Your Answer: (Not answered)

Question 28 / 29

2 marks
expr_1 and expr_2 are boolean expressions. Consider the following expression.
expr_3 = not (expr_1 or expr_2) expr_4 = (not expr_1) and (not expr_2) print(expr_3 == expr_4)
What can you say about the value of the expression given above?
Answer is Correct Score: 2 / 2
Options:
  • A. It is True if and only if both expr_1 and expr_2 have the same value.
  • B. It is False if and only if both expr_1 and expr_2 have the same value.
  • C. It is always True. ✅
  • D. It is always False.

Question 29 / 29

2 marks
E_1 and E_2 are two boolean variables. Consider the following code.
E_1 and E_2 and 1 / 0 print(E_2)
Which of the following scenarios are possible when the code given above is executed? Assume that all scenarios are independent of each other.
Answer is Correct Score: 2 / 2
Options:
  • A. The code throws an error. ✅
  • B. True is printed after line-2 is executed. ✅
  • C. False is printed after line-2 is executed. ✅
  • D. None of the above.

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.