Create a function triangle(s), which takes a string s as its argument and prints the successive characters of the string on each line. For example&
& >>> triangle("CMPT")&
C&
CM&
CMP&
CMPT&
You will implement this function in two ways:&
(a) using string slices1;&
(b) without using string slices.
1
Expert's answer
2010-10-28T09:57:50-0400
This question can be posted as an assignment to our site and our experts will assist you.
Comments
Leave a comment