String _Practical Assignment Junior Programmer
String _Practical Assignment Junior Programmer
Practical Assignment
Class : XI A
Topic : String Manipulation/Handling in Python
Junior Developers (L1)
1. Reversing a String
Write a program that takes a string as input and prints it in reverse (With Slicing)
Write a program that takes a string as input and prints it in reverse (without Slicing)
2. Removing Vowels
Write a program that takes a string as input and removes all the vowels from it. The
resulting string should only contain consonants.
3. Word Reversal
Write a program that takes a sentence as input and reverses the order of words in the
sentence. For example, "Hello World" should become "World Hello."
4. Letter Frequency
Write a program that takes a string as input and calculates the frequency of each letter
(case insensitive) in the string. Display the results in alphabetical order.
5. Password Strength Checker
Write a program that checks the strength of a password(string given by user). The
password should meet the following criteria:
At least 8 characters long
Contains both uppercase and lowercase letters
Contains at least one digit
Contains at least one special character (e.g., @, #, $, etc.)
6. User Authentication:
• Implement a function authenticate_user(login_id, password) that checks if the
provided login ID and password match a user's credentials (pretend you have a user
database).
• Display a success message if the credentials are correct, and an error message if they
are not.
7. Word Count
Write a program that counts the number of words in a given string. Words are separated
by spaces or punctuation.
8. String Encryption/ Decryption
(Encryption is the process of encoding information. This process converts the original
representation of the information, known as plaintext, into an alternative form known as
cipher text. Ideally, only authorized parties can decipher a cipher text back to plaintext and
access the original information)
Write a program that takes a string as input and encrypts it by shifting each letter in the
string by a fixed number of positions. For example, with a shift of 3, "abc" becomes "def."
9. String Concatenation
Write a program that takes a strings and concatenates all its word in the following format.
Eg. if the string S is “Python is Fun” the resultant string should be
“Python isis FunFunFun”
10. Acronym Generator
Write a program that takes a sentence as input and generates an acronym from it. For
example, "Artificial Intelligence" should become "A.I."