Menu
HI! I’m making a program that lets you type in a word and converts it to pig latin. I wrote it out in Python originally, and the program doesn’t work. Is there something wrong with my for loop??
[CODE]<HTML>
<HEAD>
<SCRIPT LANGUAGE = “JavaScript”>
var original = prompt(‘Type a word’);
var count = 0
var istrue = False
var suffix = “”
var modified = “”
var letter;
for (letter in original)
{
if (!(istrue)){
if(letter (!(in “aeiouy”)){
suffix = suffix + letter;
}
if(letter in “aeiouy”){
istrue = True;
}
}
if(istrue){
modified = modified + letter;
}
}
alert(modified + suffix + “ae”);
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>