Programmation
782 documents à télécharger gratuitement
Cours, examens, TD, TP et exercices de programmation. Thèmes couverts : algorithmique, langage C, Java, Python, POO, structures de données.
This document outlines an exercise in which a script is created to manage a database of student information using a dictionary. It involves writing two functions: one for filling the dictionary with user-inputted data and another for consulting student details based on a given name. The final output formats the student's age and height in a clear text format.
This document introduces Python's associative arrays (dictionaries) and sets, along with their characteristics and operations. It explains dictionary basics, emphasizing key-value pairing, accessing and modifying data, iteration, and related methods. Sets, including mutable sets and immutable frozensets, are explored with focus on their unique elements, mathematical operations, and usage. Comprehensive examples demonstrate syntax, functionality, and distinctions between data structures.
This document provides an overview of dictionaries in Python, detailing their characteristics, syntax, and examples. It covers operations such as adding, removing, and accessing elements, as well as iterating through dictionaries. The key concepts around associative arrays are also discussed.
The document serves as an introductory guide to Python programming, covering its historical background, core characteristics, and use cases among major organizations. It provides an overview of Python's syntax, data types (including int, float, complex, bool, and str), and fundamental operations like arithmetic and logical expressions. The document also introduces installation methods, interactive/script modes, and input/output operations while emphasizing Python's simplicity, portability, and extensibility. It concludes with examples of practical usage and key rules for Python's syntax and...
Ce document présente une introduction au langage de programmation Python, en détaillant ses caractéristiques, son historique et des exemples d'utilisation. Il aborde également la façon d'installer Python et les environnements de développement adaptés. Enfin, le document explique les différents modes d'utilisation de Python.
This document outlines Activity 3.1 related to an introduction to Python programming. It poses a question about a concept mentioned in a video that is not included in the course PDF. Additionally, it requires writing a program to determine the length of a given string using the mentioned concept.
This document involves an exercise aimed at beginners in Python programming. It presents a list of numbers and requires the implementation of two functions: one to find the maximum value and another to categorize the numbers into even and odd. The exercise is designed to foster understanding of basic programming concepts and function definitions.
This document provides a comprehensive guide to Python functions, starting from their declaration and syntax, including `def`, docstrings, parameters, and return statements. It explains argument handling with default values, positional, and named arguments, and discusses scope through local and global variables. More advanced topics like function nesting, the use of the `global` keyword, and anonymous `lambda` functions are also covered in a concise yet systematic manner. Numerous examples illustrate these programming constructs clearly.
This document is a tutorial on Python functions, covering function declaration, calling functions, variable scopes, and the use of lambda functions. It includes examples and explanations of local and global variables, along with function nesting. The document aims to enhance understanding of function usage in Python programming.
This document provides an introduction to Object-Oriented Programming (OOP) concepts, including classes, objects, encapsulation, inheritance, polymorphism, and abstraction. It outlines the definition of classes, object creation, and the importance of these concepts in programming. The content is structured as a textbook chapter for educational purposes.
This document serves as an introduction to the concept of Information Retrieval (IR), presenting its definitions and various methodologies for extracting relevant information from vast collections of unstructured data. It discusses the different types of data involved, highlights the challenges faced in IR, and includes practical examples to illustrate the concepts presented. Additionally, it compares Data Retrieval and Information Retrieval, showcasing the unique characteristics of each.
This document presents a programming exercise related to financial mathematics. It involves calculating the accumulated value of an investment made under compound interest. The exercise spans a 10-year period with annual deposits.
This document outlines an activity focused on calculating the potential roots of a quadratic equation. It provides a reminder of the quadratic formula and details on how to determine the number of real roots based on the discriminant. The document specifies the conditions for having two, one, or no real roots for the equation ax² + bx + c = 0.
This document provides an overview of control structures in Python, including conditional statements, iterative structures, and sequence interruptions. Conditional structures, such as the 'if' statement, are used to execute instructions based on specific conditions with an emphasis on indentation. Iterative structures, such as 'while' and 'for' loops, are detailed with various examples for handling ranges, collections, and specific conditions. It also explains sequence interruption using 'break' and 'continue' statements to fine-tune loop execution and control program flow.
This document covers control structures in Python, focusing on conditional statements and iterative structures. It includes detailed explanations and examples of 'if', 'while', and 'for' statements. Additionally, it discusses the use of 'break' and 'continue' statements to control loop execution.
This document describes how to calculate the ideal body mass (BMI) for adult males and females using a specific set of mathematical formulas based on height. It provides distinct formulas for males and females that incorporate height adjustments for optimal weight estimation. The task requires writing a Python program named BMI.py to automate these calculations for any provided height. The exercise emphasizes practical programming and the application of mathematical models.
This document introduces learners to basic Python operations using the interpreter. It includes exercises on arithmetic operations, variable assignment, and operator precedence. Students are asked to predict the outcomes of Python instructions and validate results manually. The focus is on understanding arithmetic priority and operator behavior in programming contexts.
The document contains exercises for using a Python interpreter focusing on basic mathematical operations and operator precedence. It requires the user to input various expressions and analyze their outcomes. Additionally, it emphasizes understanding the rules of operation priority in mathematical calculations.
This document explores operations with strings and dates in R programming. It covers techniques such as character counting, case conversion, string splitting, and substring extraction, along with date manipulation using UNIX time and various R functions. Examples demonstrate formatting adjustments, date operations, and leveraging built-in utilities for real-world scenarios. Finally, it introduces regular expressions for advanced text pattern matching in datasets like email domains.
This document covers various functions for manipulating strings in the R programming language. It discusses reading text from a file, counting characters, converting case, replacing characters, splitting strings, and sorting words. Examples are provided throughout to illustrate these operations.
This document covers the fundamental control structures in R, including conditional statements and loops. It provides examples of using 'if', 'for', and 'while' statements, as well as logical and comparison operators. The document also introduces functions in R and how to define user-defined functions.
This document provides a comprehensive explanation of data structures in R, focusing on arrays, matrices, lists, and data frames. It details their creation, manipulation, and access methodologies, providing practical examples for each structure. Key operations like insertion, deletion, and repositioning of data within these structures are covered. The guide is aimed at helping users understand how to effectively manage collections of data using R programming language.
This document serves as an educational manual introducing the basic principles of programming using the R language. It covers fundamental concepts such as mathematical operations, variable assignments, string manipulations, and operator precedence. It also delves into the use of vectors and factors, explaining how data can be stored, categorized, and manipulated within R. Practical examples and basic operations are demonstrated for clarity and hands-on learning.
This document provides an introduction to the Java programming language, covering fundamental concepts such as program structure, variables, control statements, and loops. It emphasizes the object-oriented nature of Java and explains how to set up a Java development environment. Sample code snippets and methods are provided to illustrate the principles discussed.























