The Joy of Computing using Python Week 3: Programming Assignment - Jan-Jun 2022

 NPTEL PROGRAMMING ASSIGNMENTS

The Joy of Computing Using Python


Week 3: Programming Assignment 1

Due Date of Submission 2022-02-17, 23:59 IST
You are given a list named L. Print all the elements at odd position of list L. (Take care of the input, just have to print elements present at odd position)

Input:

A List L

Output 

All elements present at odd position

L = [int(i) for i in input().split()]

 

 



Week 3: Programming Assignment 2

Due Date of Submission 2022-02-17, 23:59 IST
You are given a list L. Print the list of first 3 smallest elements in ascending order and last 2 greatest elements in descending order of the list L respectively.(We will take care of the input)

Input

A list L

Output

A list of first 3 smallest elements in L in ascending order
A list of last 2 greatest elements in L in descending order

L = [int(i) for i in input().split()]

 

 



Week 3: Programming Assignment 3

Due Date of Submission 2022-02-17, 23:59 IST
You are given a list L. Write a function all_even that accepts the list L and print all the even numbers is the list L.(Order of the numbers should be same as the order present in the list)

We will take care of the input.

Input

A list L

output

all the even numbers in list

 

 


Post a Comment (0)
Previous Post Next Post