Social Icons

Monday, May 31, 2021

Python-courses-python-exercises-python--Python-courses-configure script-run-script

Exercise 47

Write a Python algorithm as a function that takes a list L as a parameter and returns the sum of elements of the list L with odd index. Example if L = [3, 2, 5, 11, 21, 4, 7], the algorithm returns the number L[1] + L[3] + L[5] = 2 + 11 + 4 = 17.

Solution

Sunday, May 30, 2021

Python-courses-python-exercises-python-for-while

Exercise 46

Write a Python algorithm as a function which takes as parameter a string variable s and which returns the list of all uppercase characters found in s.

Solution

Friday, May 28, 2021

python-tutorial-Python-courses-python-exercises

Exercise 45

Write a Python algorithm as a function which takes as parameter a list of real numbers L and which returns the list obtained from L by removing all integers.

Solution

Python-courses-python-exercises-python-exception-python-pip

Exercise 44

Write a Python algorithm as a function which takes as a parameter a list of integers L and which returns the list obtained from L by moving all zeros to the beginning of the list. Example if L = [7, 0, 11, 0, 25, 16, 0, 14], the algorithm returns the list: [0, 0, 0, 7, 11, 25, 16, 14]

Solution

Thursday, May 27, 2021

Python-courses-python-exercises-python-files

Exercise 43

Write a Python algorithm as a function which takes as parameter a list of integers L and which returns the list obtained from L by removing all negative numbers. Example if L = [7, -2, 11, -25, 16, -3, 14], the algorithm returns the list: [7, 11, 16, 14]

Solution

Tuesday, May 25, 2021

Python-courses-python-exercises

Exercise 42

Write a Python algorithm as a function which takes as a parameter a list of integers L and which returns the list obtained from L by inserting just after each number the string 'even' or 'odd' depending on the parity of number. Example if L = [2, 11, 25, 6, 14], the algorithm returns the list: [2, 'even', 11, 'odd', 25, 'odd', 6, 'even', 14, 'even']

Solution

python-tutorial-Python-courses-python-exercises

Exercise 41

Write an algorithm in python that extracts from a list of numbers the sublist of numbers whose last digit is even and the second is odd. Example if: L = [21, 14, 346, 728, 136, 19], the algorithm returns the list: [14, 136]

Solution

Sunday, May 23, 2021

Python-courses-python-exercises-python-students-online-courses

Exercise 40

Write a Python algorithm that extracts from a list of numbers the sublist of numbers that end with an even number. Example: if L = [21, 14, 346, 728, 13, 19], the algorithm returns the list: [14, 346, 728]

Solution

Saturday, May 22, 2021

Python-courses-python-exercises-python-dictionary

Exercise 37

Write a python algorithm that extracts from a given list of numbers the sublist made up of numbers that contain the digit 3.

Solution

Friday, May 21, 2021

Python-courses-download-Python-courses-s-Python-courses

Exercise 36

Write a Python algorithm as a function which takes as parameter a couple (listScores, listCoefficients) and which returns the average obtained, where listScores designates the list of scores obtained by a students and listCoefficients designates the list of associated coefficients

Solution

Python-courses-python-exercises

Exercise 35

Write a python algorithm as a function which takes as parameter a string text T and which returns the list of words containing at least one number and one capital letter. Example: if T = 'Python2.7 has been replaced by Python3.X since 2018', the algorithm return: ['Python2.7', 'Python3.X']

Solution

Thursday, May 20, 2021

Python-courses-python-exercises-python-list

Exercise 34

Write a Python algorithm as a function which takes a string text T as a parameter and which returns the list of words containing at least two digits. Example: if T = 'Python2.7 is replaced by Python3.X since 2018', the function returns the list ['Python2.7', '2018']

Solution

Unix -Python-courses-Solaris, Linux, FreeBSDPython-courses-python-exercises-python

Exercise 33

Write a Python program as a function which takes a list L as a parameter and returns the list obtained by performing a circular permutation on the list L. Example if L = [41, 11, 34, 20, 18, 6], the program returns: the list: [6, 41, 11, 34, 20, 18]

Solution

Wednesday, May 19, 2021

Python-courses-python-exercises-python-exception-python-pip

Exercise 32

Write a Python program that move the first 3 elements of a given list and place them at the end of the list. Example if L = [25, 13, 11, 1, 4, 31, 18, 6, 12, 1, 7], the program returns: the list: [1, 4, 31, 18, 6, 12, 1, 7, 25, 13, 11]

Solution

Unix -Python-courses-Solaris, Linux, FreeBSDPython-courses-python-exercises-python

Exercise 31

For given a list of integers L, write a Python algorithm that returns the list of tuples (n, m) verifying n + m <10. Example: if L = [11, 3, 2, 22, 4, 31, 18, 6, 12, 1, 7], the algorithm returns: the list: [(3, 3), (2, 3), (4, 3), (6, 3), (1, 3), (3, 2), (2, 2), (4, 2), (6, 2), (1, 2), (7, 2), (3, 4), (2, 4), (4, 4), (1, 4), (3, 6), (2, 6), (1, 6), (3, 1), (2, 1), (4, 1), (6, 1), (1, 1), (7, 1), (2, 7), (1, 7)]

Solution

Python-courses-python-exercises-games-Python-courses-

Exercise 30

Write a Python algorithm that determines the list of words containing no digits in a given T text.

Solution

Monday, May 17, 2021

Python-courses-python-exercises-python-dictionary

Exercise 29

Write a Python algorithm that determines the list of words containing at least one digit in a given T text.

Solution

Python-courses-python-exercises-python-Array, String, user Inputs packages

Exercise 28

Write a Python algorithm that determines the list of words containing at least one capital letter in a given T text.

Solution

Python-courses-download-Python-courses-s-Python-courses

Exercise 27

Write a Python algorithm that determines the list of words starting with a capital letter in a given text T.

Solution

Python-courses-python-exercises

Exercise 26

For a given list L of integers, write an algorithm in Python that return the tuple of lists (l_even, l_odd) where l_even designates the list of even integers of L and l_odd designates the list of odd integers of L. Example for L = [11, 3, 22, 14, 31, 18, 12, 7] the program returns the pair of lists: ([22, 14, 18, 12], [11, 3, 31, 7])

Solution

python-tutorial-Python-courses-python-exercises

Exercise 25

Write a Python program that determines the list of words not containing the letter 'a' in a given text.

Solution

Tuesday, May 11, 2021

Python-courses-python-exercises-python--Python-courses-configure script-run-script

Exercise 24

Write a Python algorithm as a function which takes as parameter a couple (L, a) formed by a list L and an element 'a' and which returns the position of the element 'a' in the list L without using the index() method or any other built-in Python method. The function should return -1 if element 'a' is not present in the list L.

Solution

Python-courses-python-exercises-python--Python-courses-configure script-run-script

Exercise 23

Write an algorithm in python that returns the number of occurrences of an 'a' element in a given list L without using any predefined functions in Python. Example if L = [7, 23, 5, 23, 7, 19, 23, 12, 29] and a = 23, the algorithm returns 3.

Solution

Friday, May 7, 2021

Exercise 22

Write an algorithm in python that returns the list of duplicate elements of a given list without using any predefined functions in Python. Example if L = [7, 23, 5, 12, 7, 19, 23, 12, 29], the algorithm returns the list [7, 23, 12].

Solution

Scalable-Python-programming languages-Python-courses-python-exercises

Exercise 21

Write a Python algorithm that returns the list of duplicate elements of a given list. Example if L = [7, 23, 5, 12, 7, 19, 23, 12, 29], the algorithm returns the list: [7, 23, 12]

Solution

Python-courses-python-exercises-python-students-online-courses

Exercise 20

Write a Python algorithm which returns the maximum of the list without using any predefined function in Python.

Solution

Thursday, May 6, 2021

features-Python-courses-python-exercises-python-oop

Exercise 19

Write an algorithm in python as a function which takes as parameter a list of numbers L and which returns the minimum of the list without using any predefined function in Python.

Solution

it-Python-courses-python-string--Python-courses-python-exercises

Exercise 18

Write a Python program that determines the symmetric difference of two lists L1 and L2, i.e. the list made up of the elements of L1 which are not in L2 and the elements of L2 which are not in L1 Example if: L1 = [11, 3, 22, 7, 13, 23, 9] L2 = [5, 9, 19, 23, 22, 23, 13] The program returns the list [11, 3, 7, 5, 19]

Solution

def symetricDifference(L1 , L2):
    # initialiser la liste difference sysmétrique de L1 et L2
    diffSym = []
    for x in L1:
        if x not in L2:
            diffSym.append(x)
    for x in L2:
        if x not in L1:
            diffSym.append(x)
    return diffSym
#Example
L1 = [11 , 3 , 22 , 7 , 13 , 23 , 9]
L2 = [5 , 9 , 19 , 23 , 22 , 23 , 13]
print("The symetric difference of L1 and L2 is : " , symetricDifference(L1 , L2))
# The output is: The symetric difference of L1 and L2 is :  [11, 3, 7, 5, 19]


Younes Derfoufi
my-courses.net
Scalable-Python-programming languages-Python-courses-python-exercises

Exercise17

Write a Python program that determines the difference of two lists. Example if: L1 = [11, 3, 22, 7, 13, 23, 9] L2 = [5, 9, 19, 23, 10, 23, 13] the program returns the list: [11, 3, 22, 7]

Solution

Tuesday, May 4, 2021

Exercise 16

Write a program in python that randomly mixes the elements of a given list.

Solution

Monday, May 3, 2021

Python-courses-python-exercises-python-certification

Exercise 15

Write a Python program in the form of a Python function which takes two lists as parameters and returns the list of elements common to these two lists.

Solution

Python-courses-python-exercises-python-for-while

Exercise14

Write a Python program as a function that takes two lists as parameters and returns True if the two lists have at least one common element and False if not.

Solution

it-Python-courses-python-string--Python-courses-python-exercises

Exercise 13

Write a python algorithm to remove duplicate elements from a list.

Solution

Exercise 95*

Write a Python function to get any string/sentence and returns the most repeated word.

Solution

Exercise 94*

Write a Python program as function that takes as parameter a string s and which returns the list repeated word within the string s. Example: if s = "Python is object oriented programming language. Python is also also used for data sciences", the fuction returns the list: ['Python', 'is', 'also']

Solution

Python Exercises With Solutions

  1. Exercises on Python Strings
  2. Exercises on Python lists
  3. OOP Exercices with solutions
  4. Exercises on Python File I/O
  5. Python Dictionary Exercises
  6. Python Sets Exercises
  1. Python Arithmetic Exercises
  2. Equations & System Of Equations
  3. Polynomials and Functions
  4. Python Arithmetic Exercises 
  5. Numpy, Matplolib, Sympy , Scipy - Exercises
  6. Python Arithmetic Exercises
  1. Python GUI Tkinter Exercises



Younes Derfoufi

Category Of Mobile Courses

Actualités (644) Adsense (1) Affiliation (1) Algebraic Topology (2) Algorithmic (1) all-news (30) Android (5) Android App (8) Android app without code (4) Android Apps (256) Android Development (4) Android download (2) Android OS (3) AngularJS (1) Automata theory and formal language (5) Bootstrap CSS (1) C programming (5) Category and Functor (8) CMS (3) Computer Glossary (18) Create Mobile App With Ionic Framework (2) CSS (2) CSS-Cascading-Style-Sheets (4) Developpement Java (13) Differential Geometry (1) Django-Python-Framework (9) dropshiping (26) Earn Money by Internet (4) Emplois (23) Framework php (2) Fraud (2) HTML (7) Java For Beginners (10) Javascript (12) Kotlin Programming Language (8) Kotlin For Mobile Android (1) Linux Download (2) Marketing (5) Mobile (3) Mobile Courses (4) Mobile Marketing (4) MoneyGram (1) News (721) Node.js (5) Open Source (1) Photoshop (1) Protect Computer (1) Python (35) Python BeautifulSoup (1) Python For Data Science (2) Python PyQt (4) Python Reference (1) Python Source Code (1) Python-Books (6) Python-DVD-Training (1) Python-Exercises (297) Python-Framework (1) Python-IDE (1) Python-Kivy-Framework (2) Python-Modules (1) Python-pdf (2) Python-pyQt (1) Référencement (2) Script PHP (2) Security (6) SEO (1) Snipping Tool: Faq (1) Social Networks (1) Source Code (4) Statistics With SPSS (2) Surveillance Software (1) Travail à domicile (6) Tutoriels php en vidéos (2) Tutoriels-MySql (6) tutoriels-php (19) Utilitaires (1) VPS (1) Web Hosting (1) Webcam (1) Webmarketing (11) Western Union (1) Windows 10 (1) Windows 7 (4) Windows 7 Faq (2) Windows 8 (1) Windows Accessories (1) Windows Download (8) Windows Drivers (1) Windows Fonts (1) Windows Power Shell (2) Windows Registry (2) Windows Security (18) Windows Software (2) Windows Spyware (2) Windows utilities (3) Windows Virus (2) Windows Vista (3) Windows Wireless (1) Windows xp (1) Wordpress (1)
 

Sample text

Sample Text

 
Blogger Templates