Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/guermoud98/python


https://github.com/guermoud98/python

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Python List Operations Exercises

# Exercice 1

This Python program demonstrates various operations that can be performed on a list. The program performs the following tasks:

- Define a list 'liste' with elements [170, 3.8, 0, 22, 7.2, 55, 18]
- Sort and print the list.
- Append '.05' to the list and print the updated list.
- Reverse and print the list.
- Remove '3.8' from the list and print the updated list.
- Print the index of '3.8'.
- Print the index of '22'.
- Print the sublist from the 3rd element to the end of the list.
- Calculate and print the sum of all elements in the list.
- Calculate and print the product of the 2nd element to the end of the list.
- Add a for loop to print integers from 0 to 15 (exclusive) in steps of 3 using range() function.

# Exercice 2

This Python program contains various functions for manipulating lists. The program performs the following tasks:

- uniqueElement() : a function that finds the unique elements in a list.
- unique() : a function that finds the elements common to two lists.
- length_sup_four() : a function that finds all strings with a length greater than 4.
- sup_ten() : a function that finds all integers greater than 10 in a list.
- string_upper_case() : a function that converts strings to uppercase.
- sum_of_elements() : a function that finds the sum of all the elements in a given list.
- squareList() : a function that returns a list of the squares of integers.
- powList() : a function that returns a list of the powers of integers.