Lab#4 Ex1_chap8_and_ex3_chap10
- OpenOpen
First part :A function that takes a string as an argument and displays the letters backward, one per line.
Second part: A function that takes a list of numbers and return the cumulative sum. That is a new list where the elements is the sum of the first ith elements of ths original list.
Recent Discussions
Sorry, there were no discussion topics found.
Recent Docs
#Ecercice 3 chapter 10 # def add_all(t): total=0 for x in t: total=total+x return total def cumulativesum(listnum): cumsum=[ ] istr=1 i=int(istr) n=len(listnum) while i<n: xlist=listnum[0:i] s1=add_all(xlist) s=list(s1) import See MoreCumulative sum
# Exercice 1 chapter 8 # function that takes a string as an argument and display the letters backward, one per line def string_backward(word): lengh=len(word) while See MoreDisplay letters backward