0% found this document useful (0 votes)
15 views6 pages

Python Basics: Arithmetic Operators

The document outlines an assignment for the NPTEL course 'Programming with Generative AI', detailing various questions and answers related to algorithms, data-centric problems, and the use of Generative AI in coding. It includes submission details, scores, and accepted answers for multiple-choice questions. The assignment is part of a structured course with weekly topics and assessments.

Uploaded by

Prashanth H A
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

Python Basics: Arithmetic Operators

The document outlines an assignment for the NPTEL course 'Programming with Generative AI', detailing various questions and answers related to algorithms, data-centric problems, and the use of Generative AI in coding. It includes submission details, scores, and accepted answers for multiple-choice questions. The assignment is part of a structured course with weekly topics and assessments.

Uploaded by

Prashanth H A
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

X

([Link] ([Link]

prashanth049@[Link] 

NPTEL ([Link] » Programming with Generative AI (course)

Course Week 1 Assignment 1


outline The due date for submitting this assignment has passed.
Due on 2025-08-27, 23:59 IST.
Week 1 ()

How does an
Assignment submitted on 2025-08-27, 23:54 IST
NPTEL 1) Select all statements that are true about an algorithm from the options below. 1 point
online
course It is a finite sequence of instructions
work? () Each instruction is written in Python
Some instructions can be executed more than once
Week 1 Part
1 Some instructions can be executed infinitely often
Introduction No, the answer is incorrect.
() Score: 0
Accepted Answers:
Week 1 Part It is a finite sequence of instructions
2 Getting Some instructions can be executed more than once
started with
Python () 2) Which of the following problems are best solved using a data-centric approach? 1 point

Python Recognize the digits in a hand-written Aadhar number


resources Given an integer, determine if it is a legal Aadhar number
(unit?
Given two sentences, determine if they have the same number of words
unit=19&lesso
n=33) Given two sentences, determine if they have the same meaning

The REPL No, the answer is incorrect.


(unit?
Score: 0
unit=19&lesso Accepted Answers:
n=34) Recognize the digits in a hand-written Aadhar number
Given two sentences, determine if they have the same meaning
Basic
Arithmetic
3) Identify all true statements from the options below: 1 point
Operators
(unit? Since machine language consists of only 0's and 1's, it is easy to read code in machine
unit=19&lesso
language
n=35)
Since machine language consists of only 0's and 1's, it is easy to write code in machine
Test Your language
Understanding
It is difficult for most humans to read assembly language
(unit?
unit=19&lesso It is difficult for most humans to write assembly language
n=36) Code written in a high-level language must be converted to assembly language before a
Complex computer can understand it
Expressions Code written in assembly language must be converted to machine language before a
(unit? computer can understand it
unit=19&lesso
n=37) No, the answer is incorrect.
Score: 0
Limits to Accepted Answers:
arithmetic It is difficult for most humans to read assembly language
computation It is difficult for most humans to write assembly language
(unit? Code written in assembly language must be converted to machine language before a
unit=19&lesso computer can understand it
n=38)
4) If the following statement is true, indicate whether it is a good 1 point
Investigation
reason For or Against using Generative AI to write code. Indicate Incorrect if the statement is
sys.float_info
false.
(unit?
unit=19&lesso
n=39) Statement: Generative AI models always write correct code

Binary digits For


(bits) (unit?
Against
unit=19&lesso
n=40) Incorrect

Naming
Yes, the answer is correct.
Score: 1
Things (unit?
Accepted Answers:
unit=19&lesso
Incorrect
n=41)

Introducing 5) If the following statement is true, indicate whether it is a good 1 point


"our friend"
reason For or Against using Generative AI to write code. Indicate Incorrect if the statement is
(unit?
false.
unit=19&lesso
n=42)
Statement: Generative AI models rarely write correct code
Test Our
Friend's For
Understanding Against
(unit?
unit=19&lesso
Incorrect
n=43) No, the answer is incorrect.
Score: 0
Limits to float
Accepted Answers:
computation
Incorrect
(unit?
unit=19&lesso
n=44) 6) If the following statement is true, indicate whether it is a good 1 point
reason For or Against using Generative AI to write code. Indicate Incorrect if the statement is
Python false.
Objects (unit?
unit=19&lesso
n=45) Statement: Training Generative AI models increases CO2 emissions
Textual data
For
(unit?
unit=19&lesso Against
n=46) Incorrect
Strings (unit? No, the answer is incorrect.
unit=19&lesso Score: 0
n=47) Accepted Answers:
Against
Summary
(unit? 7) If the following statement is true, indicate whether it is a good 1 point
unit=19&lesso reason For or Against using Generative AI to write code. Indicate Incorrect if the statement is
n=48) false.
Quiz: Week 1
Assignment 1 Statement: Using Generative AI models increases CO2 emissions
(assessment?
name=65) For
Against
Weekly
Feedback Incorrect
Form (unit? Yes, the answer is correct.
unit=19&lesso Score: 1
n=49) Accepted Answers:
Against
Week 2 Part
1 Variables
8) If the following statement is true, indicate whether it is a good 1 point
and
reason For or Against using Generative AI to write code. Indicate Incorrect if the statement is
Assignments
false.
()

Statement: Generative AI models can be trained on well-written code


Week 2 Part
2 Functions
For
and Simple
Programs () Against
Incorrect
Week 3 Part Yes, the answer is correct.
1 User- Score: 1
defined Accepted Answers:
functions () For

Week 3 Part 9) If the following statement is true, indicate whether it is a good 1 point
2 Refuting reason For or Against using Generative AI to write code. Indicate Incorrect if the statement is
and false.
debugging
complex Statement: Some Generative AI models may have misused open-source code for training
functions ()
For
Week 4 Part Against
1 Helper
Incorrect
functions
and No, the answer is incorrect.
recursion ()
Score: 0
Week 4 Part Accepted Answers:
2 Asking Against
Clarifying
Questions () 10) Your friend performs an experiment in the REPL and observes the following: 1 point

Week 5 Part >>> (5 / 2) > (5 // 2)


1 Lists, True
Tuples, and
Exceptions () Select all true statements that help explain this observation.

Week 5 Part The / operator has higher precedence than the // operator
2 Iteration () The expression (5 / 2) evaluates to the float value 2.5
The expression (5 / 2) evaluates to the int value 3
Week 6
The expression (5 / 2) evaluates to the int value 2
Iteration and
Testing () The expression (5 // 2) evaluates to the float value 2.5
The expression (5 // 2) evaluates to the int value 3
Week 7
The expression (5 // 2) evaluates to the int value 2
Learning a
new Yes, the answer is correct.
language (C) Score: 1
() Accepted Answers:
The expression (5 / 2) evaluates to the float value 2.5
Week 8 Part The expression (5 // 2) evaluates to the int value 2
1 Strings
and 11) Which of the following Python expressions will result in an error? 1 point
functions in
C () Hint: Use a REPL to evaluate these expressions

Week 8 Part (1 // 2) / 3
2 1 // (2 / 3)
Demystifying
(1 / 2) // 3
Python Lists
() 1 / (2 // 3)
None of these
Live Session
Yes, the answer is correct.
() Score: 1
Accepted Answers:
1 / (2 // 3)

12) The population of India is between 140 crore and 150 crore (1.4 billion to 1.5 1 point
billion). How many bits will it take to represent this integer?

Less than 20
20
21
30
31
40
More than 40
Yes, the answer is correct.
Score: 1
Accepted Answers:
31

13) Which of the following are legal strings (str) in Python? 1 point

"Hello"
"Hello'
'With AI's help'
'With AI\'s help'
"""With AI's help"""

Partially Correct.
Score: 0.67
Accepted Answers:
"Hello"
'With AI\'s help'
"""With AI's help"""

14) Identify all expressions that evaluate to True 1 point

ord('A') == ord('a')
ord('A') < ord('a')
ord('A') == ord("A")
ord('7') == 7
(ord('A') - ord('a')) == (ord('B') - ord('b'))

Partially Correct.
Score: 0.67
Accepted Answers:
ord('A') < ord('a')
ord('A') == ord("A")
(ord('A') - ord('a')) == (ord('B') - ord('b'))

15) Your friend performs an experiment in the REPL and observes the following: 1 point

>>> 2 ** 0.5 ** 2 == 2
False

Which of these modified expressions evaluate to True?

((2 ** 0.5) ** 2) == 2
(2 ** (0.5 ** 2)) == 2
((2.0 ** 0.5) ** 2.0) == 2.0
None of these

Yes, the answer is correct.


Score: 1
Accepted Answers:
None of these

You might also like