Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guermoud98/python
https://github.com/guermoud98/python
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/guermoud98/python
- Owner: Guermoud98
- Created: 2023-03-21T21:51:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-26T13:53:49.000Z (almost 2 years ago)
- Last Synced: 2023-08-07T09:20:58.865Z (over 1 year ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.