Programming in Python - - Unit 4 - Week 4 (Contents)_ Conditional Statements and Looping
Programming in Python - - Unit 4 - Week 4 (Contents)_ Conditional Statements and Looping
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/CEC)
mathavi.2007@gmail.com
Course Assessment-4-2024
outline The due date for submitting this assignment has passed.
Due on 2024-03-17, 23:59 IST.
Week 1 Score: 10/10=100%
(Contents) :
Planning the
Computer Assignment submitted on 2024-03-09, 10:42 IST
Program () 1) Which of the following is the correct way to write a conditional statement in Python? 1 point
Week 2 if x = 2:
(Contents): if x == 2
Techniques
if x == 2:
of Problem
Solving () if x = 2 then:
https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=19&assessment=95 1/4
4/23/24, 2:14 AM Programming in Python - - Unit 4 - Week 4 (Contents): Conditional Statements and Looping
Lecture 4) How do you loop through a list [1, 2, 3, 4] and print each element? 1 point
Material (unit?
unit=19&lesso
n=23) for i in [1, 2, 3, 4]:
print(i)
Quiz:
Assessment- for i in [1, 2, 3, 4]
4-2024
print(i)
(assessment?
name=95) for i in range(1, 2, 3):
print(i)
Week 5 while i in [1, 2, 3]:
(Contents): print(i)
String
Manipulation Yes, the answer is correct.
Score: 1
()
Accepted Answers:
for i in [1, 2, 3, 4]:
Week 6
print(i)
(Contents):
Introduction
5) What will be the output of the following code? 1 point
to list. ()
c=0
for letter in 'Bangalore':
Week 7
if letter != 'o':
(Content):
Introduction c=c+1
to tuples. () pass
print(c)
Week 8
6
(Contents):
Introduction 7
to 8
dictionaries 9
()
Yes, the answer is correct.
Score: 1
Week 9
Accepted Answers:
(Contents):
8
Python
Functions ()
6) What will be the output of the following code? 1 point
https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=19&assessment=95 2/4
4/23/24, 2:14 AM Programming in Python - - Unit 4 - Week 4 (Contents): Conditional Statements and Looping
a = 15
Week 10
b = 20
(Contents) :
if a > 15 or b > 15:
Python
print("At least one of the condition is met.")
Modules ()
elif a > 15 and b > 15:
print("Both conditions are met.")
Week 11
else:
(Contents):
Input-Output print("Neither condition is met.")
()
Both conditions are met.
02468
0246
246
2468
2
110
10
12
https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=19&assessment=95 3/4
4/23/24, 2:14 AM Programming in Python - - Unit 4 - Week 4 (Contents): Conditional Statements and Looping
1, -1, -3,
0, 1, -1, -3,
-3, -2, -1,
0, -1, -2, -3, -4
Pyt
yth
tho
Py
https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=19&assessment=95 4/4