Skip to content

Instantly share code, notes, and snippets.

@iizukak
Created October 9, 2011 15:38
Show Gist options
  • Save iizukak/1273809 to your computer and use it in GitHub Desktop.
Save iizukak/1273809 to your computer and use it in GitHub Desktop.
Codeforces Beta Round #89 (Div. 2), problem: (A) String Task, 118A, Python
string = raw_input().lower()
notvowl = ".".join([c for c in string if not c in "aiueoy"])
print "." + notvowl
@shukkkur
Copy link

shukkkur commented Apr 12, 2021

can you please explain me the 2nd step?
i am new to python programming and cant understand the 2nd step.

First, the list comprehension part returns a list of consonants, and then the join('.') inserts a dot between all the characters in that list.

@Blurdroid
Copy link

why you put [] in the second step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment