anti_vowel


#1



https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096

When I run this exact code in Python 3 using syntax print each, end = '' I get it to display "Hy lk Wrds!" just fine. However, when I copy and paste the text into this web site it doesn't execute once. For Python 2 the same syntax should be, print each,

I expect the results to be the same on here as with the full program.


def anti_vowel(text):
	for each in text:
		if each.lower() != chr(97) and each != chr(101) and each != \
		chr(105) and each != chr(111) and each != chr(117):
			print each, end = ''


#2

what exactly is your question? python3 is not backward compatible with python2, so things which works in python2 don't have to work in python3 and vice versa

python broke backward compatibility when releasing python3, plenty of people where upset about this


#3

Considering how I do not know the platform of this web site that Python uses, 2 or 3, I tried both and neither work. It seems that it is not recognizing the escape character "\". Does this web site have a different escape method for when lines run off the page? Thanks.


#4

codecademy uses 2.7.3 i think. not sure of the last digit, i think the problem is in this line:

print each, end = ''

which will work in 3, but not in 2. Also, for the exercise, you might actually want to return the result, not just print it