0% found this document useful (0 votes)
4 views

Assignment CS GR XI - list (1)

The document is a fortnightly assignment for Grade XI Computer Science students at Modern School, Vasant Vihar, due on November 22, 2024. It includes a series of programming tasks in Python, such as checking for prime numbers, summing list items, and filtering based on specific conditions. The assignment aims to enhance students' programming skills through practical exercises.

Uploaded by

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

Assignment CS GR XI - list (1)

The document is a fortnightly assignment for Grade XI Computer Science students at Modern School, Vasant Vihar, due on November 22, 2024. It includes a series of programming tasks in Python, such as checking for prime numbers, summing list items, and filtering based on specific conditions. The assignment aims to enhance students' programming skills through practical exercises.

Uploaded by

jeetrc2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Modern School, Vasant Vihar

Fortnightly Assignment

Grade: Gr XI Chapter: List

Subject: Computer Science Date of Submission: Nov 22, 2024

1. Write a Python program to check whether a number entered by the user is prime or not.
2. Write a Python program to sum all the items in a list.
3. Write a Python program to find the product all the items in a list.
4. Write a Python program to get the largest number from a list.
5. Write a Python program to get the smallest number from a list.
6. Write a Python program to display :
a. Prime numbers from the list
b. Armstrong numbers from the list
c. Palindrome numbers from the list
7. Write a Python program to count the number of strings where the string length is 2 or more and the first and
last character are same from a given list of strings.
Sample List : ['abc', 'xyz', 'aba’, '1221']
Expected Result : 2
8. Write a Python program to find the list of words that are longer than n from a given list of words.
9. Write a Python program to print the numbers of a specified list after removing even numbers from it.
10. Return the sum of the numbers in the list, returning 0 for an empty list. Except the number 13 is very unlucky,
so it does not count and numbers that come immediately after a 13 also do not count.
[1, 2, 2, 1] → 6
[1, 1] → 2
[1, 2, 2, 1, 13, 4, 1] → 7

11. Display the sum of the numbers in the list, except ignore sections of numbers starting with a 6 and extending up
to the next 7 (every 6 will be followed by at least one 7).
sum67([1, 2, 2]) → 5
sum67([1, 2, 2, 6, 99, 99, 7]) → 5
sum67([1, 1, 6, 7, 2]) → 4

Page 1 of 1

You might also like