Simple Python Scripts

Scripts for simple Python programs

Sunday, 30 October 2016

Example of list comprehension

#Example of list comprehension


str=input("enter string:")

l=[i for i in str if i in ('a','e','i','o','u')]
print("number of vowels present in entered string:",len(l))

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Search This Blog

Blog Archive

  • ►  2022 (6)
    • ►  May (6)
  • ►  2018 (2)
    • ►  December (2)
  • ►  2017 (9)
    • ►  May (3)
    • ►  January (6)
  • ▼  2016 (18)
    • ►  December (7)
    • ►  November (4)
    • ▼  October (7)
      • Example of list comprehension
      • check armstrong number or not...
      • Fibonacci series using while loop
      • Dictionary for days of week & temperature
      • dictionary for student's roll no. and name
      • prime numbers from upper range to lower range
      • To check number is palindrome or not
Ethereal theme. Powered by Blogger.

Blog Archive

  • ►  2022 (6)
    • ►  May (6)
  • ►  2018 (2)
    • ►  December (2)
  • ►  2017 (9)
    • ►  May (3)
    • ►  January (6)
  • ▼  2016 (18)
    • ►  December (7)
    • ►  November (4)
    • ▼  October (7)
      • Example of list comprehension
      • check armstrong number or not...
      • Fibonacci series using while loop
      • Dictionary for days of week & temperature
      • dictionary for student's roll no. and name
      • prime numbers from upper range to lower range
      • To check number is palindrome or not