In: Computer Science
def main():
# keeping asking user for a word or
name until user enters 0
while True:
word =
input('Enter a word/name to convert (enter 0 to quit):
').upper()
if word ==
'0': break
print(convert_to_soundex(word))
Whenever i try to run the program it tells me unintend doesn't match any outer identation level !!!!
Answer:
Code:
def main():
# keeping asking user for a word or name until user enters 0
while True:
word = input('Enter a word/name to convert (enter 0 to quit):
').upper()
if word == '0':break
print("Hi")
main()
Explanation: Look at the line after while loop , that is if condition. If condition is not indented correctly. And then the print(function()) is also not indented properly. I have given the code and as well as the screen shot of that indentation. Please follow the screen shot for the better understanding.
Note: Please note that ,I have changed the content in the print function for the better explanation.
Indentation:
Output: