×
Reviews 4.9/5 Order Now

Create A Program to Print String After Removing Vowels in Python Assignment Solution

July 05, 2024
Prof. James Harper
Prof. James
🇦🇪 United Arab Emirates
Python
Prof. James Harper is an experienced software developer and educator with a Master's degree in Computer Science from the University of Melbourne. With over 900 completed assignments, he specializes in Python programming and application development. Prof. Harper's passion for teaching and extensive industry experience ensure that his solutions are not only functional but also well-documented and easy to understand.
Key Topics
  • Instructions
  • Requirements and Specifications
Tip of the day
When doing Java assignments, pay attention to object-oriented principles like encapsulation and inheritance. Write clean, modular code, and always test with edge cases. Using meaningful class and method names will make your program easier to understand and debug.
News
The C++ library deal.II version 9.7, out July 2025, enhances the finite-element method toolkit with more mesh adaptivity, parallelization, and tutorial improvements—useful for numerical simulations or academic modelling work.

Instructions

Objective

Write a python assignment program to print string after removing vowels.

Requirements and Specifications

Program to print string after removing vowels in python language

Source Code

def process_string(s): """ Method for processing given string. Returns the same string with all the vowels removed and also capitalizes all the cononsnats :param s: input string :return: result of string processing """ # initializing result string with an empty string result = '' # iterating over all the characters of the given string for c in s: if c.isalpha(): # if character is a letter, not skipping it only if it is not a vowel if c.lower() not in ['a', 'e', 'i', 'o', 'u']: # if letter is not a vowel (consonant) - adding uppercased letter to the result result += c.upper() else: # if character is not a letter, just keeping it in result string result += c # returning obtained result return result if __name__ == '__main__': keep_asking = True while keep_asking: # prompting user to input a string s1 = input('Please, enter a string to process: ') # getting processed string s2 = process_string(s1) # outputting result print('Result:', s2)

Related Samples

Explore our curated collection of expertly solved Python assignment samples. Whether you're tackling basic syntax or complex data structures, our samples showcase comprehensive solutions crafted by Python programming experts. Gain insights and inspiration for your projects.