Lab #4
- OpenOpen
Write a function that makes a string as an argument and displays the letters backward, one per line.
prefixes=”JKLMNOPQ”
suffix=”ACK”
for letter in prefixes:
print(letter + suffix)
the output is:
JACK
KACK
LACK
MACK
NACK
OACK
PACK
QACK
Of course, thats not quite right because “OUACK” and “QUACK” are misspelled. Modify the program to fix the error.
prefixes=”JKLMN”
suffix=”ACK”
for letter in prefixes:
print (letter + suffix)
prefixes_2=”O”
suffix_2=”UACK”
for letter in prefixes_2:
print(letter + suffix_2)
prefixes_3=”P”
suffix_3=”ACK”
for letter in prefixes_3:
print(letter + suffix_3)
prefixes_4=”Q”
suffix_4=”UACK”
for letter in prefixes_4:
print(letter + suffix_4)
Recent Discussions
Sorry, there were no discussion topics found.
Recent Docs
No Recent Docs