Logic Building
# Take string input
s = input("Enter a string: ")
# Remove vowels
vowels = "aeiouAEIOU"
result = ""
for char in s:
if char not in vowels:
result += char
print(f"Without vowels: {result}")Output
Enter a string: Hello Without vowels: Hll
Build new string excluding vowels.
Key Concepts:
- Check if character not in vowels
- Add to result if not vowel
- Build new string