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

Python Programming .: String Manipulation, List Manipulation, Tuples & Dictionaries

The document discusses Python programming concepts related to string manipulation, list manipulation, tuples, and dictionaries. It provides 12 questions to write programs on these topics, including checking if a string is a palindrome, printing a pattern without nested loops, checking if a number contains zero, manipulating lists and tuples, and manipulating dictionaries.

Uploaded by

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

Python Programming .: String Manipulation, List Manipulation, Tuples & Dictionaries

The document discusses Python programming concepts related to string manipulation, list manipulation, tuples, and dictionaries. It provides 12 questions to write programs on these topics, including checking if a string is a palindrome, printing a pattern without nested loops, checking if a number contains zero, manipulating lists and tuples, and manipulating dictionaries.

Uploaded by

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

Python programming….

Topic –
String manipulation,
List manipulation,
Tuples &
Dictionaries
Contents:-

String Manipulation…...

 Write A program To Input A String And Check If It Is A


Palindrome String Using A String Slice.
 Write A Program That Prints The Pattern Without Using
Nested Loop.
 Write A Program To Input An Integer And Check If It Contains
zero In It.

List manipulation……

 Write A Program To Create A Copy Of List. In The List’s Copy,


Add 10 to Its First and Last Elements. Then Display The List
 Write A Program That Input A List, Replicates It Twice And
Then Prints The Sorted List In Ascending And Descending
Order.
 Write A Program To Print Elements Of List[ ] In
Separate Lines Along With Element’s Both Indexes
(Positive Nd Negative.).


Tuples……

 Write a program to check if the elements in the first half of a tuple


are sorted in ascending order.
 Write a program to input a tuple and check if it contains all
elements as same
 Write a program to check if the minimum element of a tuple lies
at the middle position of a tuple.

Dictionaries…..

 Your school has decided to deposit scholarship amount of rs.2500/-


to some selected students. Write a program to input the selected
students” roll numbers and create a dictionary for the same.
 Write a program to create a dictionary with 10 keys 0….9
 Write a program to create a third dictionary from two dictionaries
having some keys, in way so that the values of common keys are
added in the third dictionary.
Q1. WRITE APROGRAM TO INPUT A STRING AND CHECK
IF IT IS A PALINDROME STRING USING A STRING SLICE.
Q2. WRITE A PROGRAM THAT PRINTS THE PATTERN
WITHOUT USING NESTED LOOP.
Q3. WRITE A PROGRAM TO INPUT AN INTEGER AND
CHECK IF IT CONTAINS 0 IN IT.
Q4. WRITE A PROGRAM TO CREATE A COPY OF LIST. IN
THE LIST’S COPY, ADD 10 TO ITS FIRST AND LAST
ELEMeNTS. THEN DISPLAY THE LIST.
Q5. WRITE A PROGRAM THAT INPUT A LIST,
REPLICATES IT TWICE AND THEN PRINTS THE SORTED
LIST IN ASCENDING AND DESCENDING ORDER.
Q6. WRITE A PROGRAM TO PRINT ELEMEMTS OF LIST[ ]
IN SEPARATE LINES ALONG WITH ELEMENT’S BOTH
INDEXES (POSITIVE ND NEGATIVE.).
Q7. Write a program to check if the elements in
the first half of a tuple are sorted in ascending
order.
Q8. Write a program to input a tuple and check if
it contains all elements as same.
Q9. Write a program to check if the minimum
element of a tuple lies at the middle position of a
tuple.
Q10. Your school has decided to deposit
scholarship amount of rs.2500/- to some selected
students. Write a program to input the selected
students” roll numbers and create a dictionary
for the same.
Q11. Write a program to create a dictionary with
10 keys 0….9.
Q12. Write a program to create a third
dictionary from two dictionaries having some
keys, in way so that the values of common keys
are added in the third dictionary.
Thank you……

You might also like