In Python Read the following code:
alphabet = "abcdefghіjklmnopqrstuvwxyz"
sentence = input(“Type a phrase: “)
sentence = sentence.lower()
nοrm_sentence = ""
fοr z in sentence:
if letter in alphabet:
norm_sentence += z
r_sentence = ““
for number in norm_sentence:
r_sentence ⚌ number += r_sentence
if r_sentence == norm_sentence:
print("Yes [] is one".format(sentence))
еlsе:
print("No [] is not".format(sentence))
Fix all syntax and logical codes I am really struggling with this one some help would be great!
Updated code which has no errors are as follows:
alphabet = "abcdefghіjklmnopqrstuvwxyz"
sentence = input("Type a phrase: ")
sentence = sentence.lower()
norm_sentence = ""
for z in sentence:
if z in alphabet:
norm_sentence += z
r_sentence = ""
for number in norm_sentence:
r_sentence = number + r_sentence
if r_sentence == norm_sentence:
print("Yes {0} is one".format(sentence))
else:
print("No {0} is not".format(sentence))
Mention in comments if any mistakes or errors are found. Thank you.
Get Answers For Free
Most questions answered within 1 hours.