Python Forum
Print the index of the vowels in a string
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print the index of the vowels in a string
#4
I changed the code like this!
it works as expect Smile
li=['a','e','i','o','u']
word="Rizvi"
for i in range(len(word)):
   if word[i] in li:
       print i
Output:
1 4
Reply


Messages In This Thread
RE: Print the index of the vowels in a string - by MeeranRizvi - Dec-29-2016, 12:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to print out the children index of the search tree? longmen 7 3,970 Apr-02-2022, 06:58 AM
Last Post: Yoriz
Bug How to print only vowels from an input? PP9044 8 11,026 Feb-26-2021, 04:02 PM
Last Post: Serafim
  Reading a text until matched string and print it as a single line cananb 1 2,779 Nov-29-2020, 01:38 PM
Last Post: DPaul
  Counting Vowels in Python sapphosvoice 1 4,947 May-05-2020, 04:24 AM
Last Post: buran
  How to print the docstring(documentation string) of the input function ? Kishore_Bill 1 4,553 Feb-27-2020, 09:22 AM
Last Post: buran
  Return not vowels list erfanakbari1 2 3,982 Mar-26-2019, 11:37 AM
Last Post: perfringo
  Help with finding vowels nlord7 1 2,899 Feb-27-2019, 04:40 AM
Last Post: ichabod801
  String index out of range felie04 2 6,607 Aug-17-2018, 11:18 PM
Last Post: felie04
  Functions to remove vowels and extra blanks RiceGum 10 7,610 Nov-17-2017, 05:40 PM
Last Post: heiner55
  string index out of range cusick11 9 17,410 Mar-03-2017, 11:45 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020