Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Programming in Python - - Unit 4 - Week 4 (Contents)_ Conditional Statements and Looping

The document outlines the contents of a Python programming course focused on conditional statements and looping, detailing the structure of assessments and lecture topics. It includes examples of correct syntax for conditional statements and loops, as well as quiz questions and accepted answers. The assignment submission deadline was March 17, 2024, and the document tracks scores for various assessments.

Uploaded by

rvseceprint
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Programming in Python - - Unit 4 - Week 4 (Contents)_ Conditional Statements and Looping

The document outlines the contents of a Python programming course focused on conditional statements and looping, detailing the structure of assessments and lecture topics. It includes examples of correct syntax for conditional statements and loops, as well as quiz questions and accepted answers. The assignment submission deadline was March 17, 2024, and the document tracks scores for various assessments.

Uploaded by

rvseceprint
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

4/23/24, 2:14 AM 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 

CEC (https://swayam.gov.in/explorer?ncCode=CEC) » Programming in Python (course)

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:

Yes, the answer is correct.


Week 3 Score: 1
(Contents): Accepted Answers:
Introduction if x == 2:
to Python ()
2) How do you write an if statement to check if a is NOT equal to 10? 1 point
Week 4
(Contents): if a != 10:
Conditional if a <> 10:
Statements if a =! 10:
and Looping
if a not 10:
()
Yes, the answer is correct.
Lecture 1: Score: 1
Conditional Accepted Answers:
blocks using if, if a != 10:
else and elif
(unit? 3) What will be the output of the following code? 1 point
unit=19&lesso
i=1
n=20)

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 2: Use sum=0


of for and while(i<=3):
while loops in sum=sum+i
python (unit? i=i+1
unit=19&lesso print(sum)
n=21)
0
Lecture 3:
Loop 3
manipulation 6
using pass,
9
continue,
break and else Yes, the answer is correct.
(unit? Score: 1
unit=19&lesso Accepted Answers:
n=22) 6

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.

Week 12 Neither condition is met.


(Contents): At least one of the condition is met.
Exception No Output
Handling ()
Yes, the answer is correct.
Score: 1
Accepted Answers:
At least one of the condition is met.

7) What will be the output of the following code? 1 point


for i in range(0,8,2):
print(i,end=" ")

02468
0246
246
2468

Yes, the answer is correct.


Score: 1
Accepted Answers:
0246

8) What will be the output of the following code? 1 point


x=0
while (x < 10):
x+=2
print(x)

2
110
10
12

Yes, the answer is correct.


Score: 1
Accepted Answers:
10

9) What will be the output of the following code? 1 point


for num in range(1,-4,-2):
print(num, end=", ")

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

Yes, the answer is correct.


Score: 1
Accepted Answers:
1, -1, -3,

10) What will be the output of the following code? 1 point


for i in 'Python':
if i == 't':
break
print(i, end="")

Pyt
yth
tho
Py

Yes, the answer is correct.


Score: 1
Accepted Answers:
Py

You were allowed to submit this assignment only once.

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=19&assessment=95 4/4

You might also like