2091 words
10 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Week 1 Graded Assignment 1 > **Course:** Jan 2026 - Python > Week 1 Graded Assignment 1 > **Last Submitted:** You have last submitted on: 2026-02-17, 17:34 IST --- ### Question 1 What will be the output type of the expression 5 + 2? - [x] int - [ ] float - [ ] str - [ ] bool - [ ] Invalid Expression (raises an err...

Visual strip

Relevant recall pieces for this note

Open gallery

Week 1 Graded Assignment 1

Course: Jan 2026 - Python
Week 1 Graded Assignment 1
Last Submitted: You have last submitted on: 2026-02-17, 17:34 IST

Question 1

What will be the output type of the expression 5 + 2?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: int
Accepted Answers:
int

Question 2

What will be the output type of the expression 5 / 2?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: float
Accepted Answers:
float

Question 3

What will be the output type of the expression 5 ** 2.0?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: float
Accepted Answers:
float

Question 4

What will be the output type of the expression "5 + 2"?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: str
Accepted Answers:
str

Question 5

What will be the output type of the expression 5 and 2 or "2"?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: int
Accepted Answers:
int

Question 6

What will be the output type of the expression 555[2]?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: Invalid Expression (raises an error)
Accepted Answers:
Invalid Expression (raises an error)

Question 7

What will be the output type of the expression "555"[2]?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: str
Accepted Answers:
str

Question 8

What will be the output type of the expression "555"[:2]?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: str
Accepted Answers:
str

Question 9

What will be the output type of the expression 555[::2]?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: Invalid Expression (raises an error)
Accepted Answers:
Invalid Expression (raises an error)

Question 10

What will be the output type of the expression "555""['2']"?
  • int
  • float
  • str
  • bool
  • Invalid Expression (raises an error)
Feedback/Explanation: str
Accepted Answers:
str

Question 11

What will be the output type of the expression 5 + float(2)?
  • int
  • float
  • str
  • bool
  • Raises an error
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: float
Accepted Answers:
float

Question 12

What will be the output type of the expression int(5.0) + float("2")?
  • int
  • float
  • str
  • bool
  • Raises an error
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: float
Accepted Answers:
float

Question 13

What will be the output type of the expression str(5) + str(2.0)?
  • int
  • float
  • str
  • bool
  • Raises an error
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: str
Accepted Answers:
str

Question 14

Select the expression(s) that are equivalent to the given expression.
python
3 + 4 * 5 // 2
  • 3 + (4 * (5 // 2))
  • 3 + ((4 * 5) // 2)
  • (3 + 4) * (5 // 2)
  • ((3 + 4) * 5) // 2
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: 3 + ((4 * 5) // 2)
Accepted Answers:
3 + ((4 * 5) // 2)

Question 15

Select the expression(s) that are equivalent to the given expression.
python
10 // 2 * 5 ** 2
  • ((10 // 2) * 5) ** 2
  • (10 // 2) * (5 ** 2)
  • 10 // ((2 * 5) ** 2)
  • (10 // (2 * 5)) ** 2
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: (10 // 2) * (5 ** 2)
Accepted Answers:
(10 // 2) * (5 ** 2)

Question 16

Select the expression(s) that are equivalent to the given expression.
python
(1 + 2) * (3 + 4)
  • (1 + (2 * (3 + 4)))
  • (1 + 2) * 3 + 4
  • ((1 + 2) * (3 + 4))
  • 1 + (2 * 3) + 4
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: ((1 + 2) * (3 + 4))
Accepted Answers:
((1 + 2) * (3 + 4))

Question 17

Select the expression(s) that are equivalent to the given expression.
python
4 + 3 > 2 * 1
  • (4 + 3) > (2 * 1)
  • 4 + (3 > (2 * 1))
  • (4 + 3 > 2) * 1
  • 4 + (3 > 2) * 1
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: (4 + 3) > (2 * 1)
Accepted Answers:
(4 + 3) > (2 * 1)

Question 18

Select the expression(s) that are equivalent to the given expression.
python
a and not b or not c
  • (a and (not b)) or (not c)
  • (a and not b) or (not c)
  • a and (not (b or not c))
  • a and ((not b) or (not c))
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: (a and (not b)) or (not c)
(a and not b) or (not c)
Accepted Answers:
(a and (not b)) or (not c)
(a and not b) or (not c)

Question 19

How does the Python interpreter parenthesize the following expression?
python
0 ** 1 ** 2 ** 3 ** 2
  • (((0 ** 1) ** 2) ** 3) ** 2
  • (0 ** (((1 ** 2) ** 3) ** 2))
  • 0 ** (1 ** (2 ** (3 ** 2)))
  • (0 ** ((1 ** 2) ** (3 ** 2)))
Status: Yes, the answer is correct. Score: Score: 2
Feedback: The power operator ** has right to left associativity. Hence, option (c) is the correct way of computation.
Accepted Answers:
0 ** (1 ** (2 ** (3 ** 2)))

Question 20

Select the correct statement(s) about print in python.
  • print is a keyword.
  • print can be used to disply any data type.
  • print atleast require one value.
  • print prints new line character at the end of the line.
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: print can be used to disply any data type.
print prints new line character at the end of the line.
Accepted Answers:
print can be used to disply any data type.
print prints new line character at the end of the line.

Question 21

Select the correct statement(s) about input in python.
  • Output type can be passed to input as input(type) to get output in the required type.
  • input accepts atmost one argument.
  • input is a built-in function.
  • input can be only used in python scripts and not in REPL/Notebook.
Status: Yes, the answer is correct. Score: Score: 2
Feedback/Explanation: input accepts atmost one argument.
input is a built-in function.
Accepted Answers:
input accepts atmost one argument.
input is a built-in function.

Question 22

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: 12
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: (Type: String) 12
Accepted Answers:
(Type: String) 12

Question 23

What is the value of a after executing line 4, if input given changed to 14?
Your Answer: 43
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: (Type: String) 43
Accepted Answers:
(Type: String) 43

Question 24

What is the value of a after executing line 5, if the input is changed to 23?
Your Answer: 35
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: (Type: String) 35
Accepted Answers:
(Type: String) 35

Question 25

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: 5
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: (Type: String) 5
Accepted Answers:
(Type: String) 5

Question 26

What is the value of a after executing line 4, if input given changed to 13?
Your Answer: 70
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: (Type: String) 70
Accepted Answers:
(Type: String) 70

Question 27

What is the value of a after executing line 5, if the input is changed to 8?
Your Answer: 22
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: (Type: String) 22
Accepted Answers:
(Type: String) 22

Question 28

Common data for the next 2 questions
Consider the following string:
python
word = '138412345678901938'
For what values of a and b does the following expression evaluate to True? Assume that both a and b are positive integers.
python
word[a : b] == '123456789'
Enter the value of a. (NAT)
Your Answer: (Not answered)
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: (Type: String) 4
Accepted Answers:
(Type: String) 4

Question 29

Enter the value of b.
Your Answer: 13
Status: Yes, the answer is correct. Score: Score: 1
Feedback/Explanation: (Type: String) 13
Accepted Answers:
(Type: String) 13

Question 30

E is a boolean variable. Consider the following sequence of expressions:
python
not E
not not E
not not not E
not not not not E
.
.
.
This pattern keeps repeating for a thousand lines. If line number 500 evaluates to False, what is the value of E?
Hint: Two negatives make a positive.
  • True
  • False
  • Cannot be determined
Status: Yes, the answer is correct. Score: Score: 2
Feedback: This pattern evaluates True and False for the alternate line because one not operator is added in expression each time. So, if line number 500 evaluates to False that means the even-number line evaluates False and the odd-number line evaluates True. This means the line number 1 which is not E will be evaluated as True. So, the value of E is False. Hence, option (b) is correct.
Accepted Answers:
False

Document Outline
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.