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

Bipin S Chintakindi: Roll No.:12 GR No.: 11810563 Batch.: C1

This document contains details of programming assignments for 3 labs on strings, lists, and functions. For Lab 1 on strings, the first program performs operations on a given string like printing length, characters, the string repeated, and substrings. The second program replaces a substring. For Lab 2 on lists, the first program modifies a list by changing an entry, adding to the end, removing from front, sorting, doubling, and adding to an index. The remaining programs involve separating even and odd list elements, replacing values in a user-input list, and finding duplicates. For Lab 3 on functions, the programs include printing squares of list values, multiplying all list values, counting letter cases, printing palindromes, and subtracting
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Bipin S Chintakindi: Roll No.:12 GR No.: 11810563 Batch.: C1

This document contains details of programming assignments for 3 labs on strings, lists, and functions. For Lab 1 on strings, the first program performs operations on a given string like printing length, characters, the string repeated, and substrings. The second program replaces a substring. For Lab 2 on lists, the first program modifies a list by changing an entry, adding to the end, removing from front, sorting, doubling, and adding to an index. The remaining programs involve separating even and odd list elements, replacing values in a user-input list, and finding duplicates. For Lab 3 on functions, the programs include printing squares of list values, multiplying all list values, counting letter cases, printing palindromes, and subtracting
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Bipin S Chintakindi

Roll no.:12
GR no.: 11810563
Batch.: C1

Lab 1] Strings

Program 1] Perform following operations in the given string.


1. Print length of the string.
2. Print number of characters
3. Print the string 10 times
4. Print first character of the string
5. First three characters of the string
6. Last three characters of the string
7. Reverse of the string entered
8. Print seventh character of the string or print string is not long enough of less than 7.
9. Replace all ‘a’ characters with ‘e‘.
Program 2] Write a program to replace “not that poor” with “good”

Program 3] Write a program to show the use of splitting function.


Lab 2] Lists
Program 1] Start with the list [8, 9, 10] and perform the following operations.
1) Set the second entry to 17
2) Add 4, 5, 6 to the end of the list.
3) Remove the first entry.
4) Sort the list.
5) Double the list.
6) Add 25 at index 3.

Program 2] A program that takes the list and put even and odd elements in two separate lists.

Program 3] Ask the user to enter a list containing numbers between 1 and 12 and replace all the entries greater than
10 with 10.
Program 4] To find duplicates in the list.

Lab 3] Functions

Program 1] Print squares of the numbers in the list.


Program2] Multiply all the numbers in the list and return the result.

Program 3] Print number of upper case and lower case letters separately.
Program 4] Print palindrome sequence.

Program 5] Write a function which takes two numbers and return subtraction of numbers.

You might also like