Lab#4 Ex1_chap8_and_ex3_chap10

active 10 years, 11 months ago
Lab#4 Ex1_chap8_and_ex3_chap10
This Project is OPEN.
School / Office
Technology & Design
Project Description

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.

Acknowledgements

This project was created by: Anne Menmou

Recent Discussions

Sorry, there were no discussion topics found.

Recent Docs

Cumulative sum

#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

Display letters backward

# 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