Mini-projet4-python-beta2 Flipbook PDF


42 downloads 117 Views 193KB Size

Recommend Stories


Porque. PDF Created with deskpdf PDF Writer - Trial ::
Porque tu hogar empieza desde adentro. www.avilainteriores.com PDF Created with deskPDF PDF Writer - Trial :: http://www.docudesk.com Avila Interi

EMPRESAS HEADHUNTERS CHILE PDF
Get Instant Access to eBook Empresas Headhunters Chile PDF at Our Huge Library EMPRESAS HEADHUNTERS CHILE PDF ==> Download: EMPRESAS HEADHUNTERS CHIL

Story Transcript

Mini projet 4 : Utiliser PyScripter pour écrire le programme1 Python suivant :

Résolution d’un problème : Entrées

Traitements

1. Les opérations élémentaires simples

ALGORITHME Nom DEBUT a. L'opération d'entrée : Les entrées Lire (x) x=input('donner x') Traitements b. L'opération de sortie Les sorties Afficher ("Message", x, x+10) FIN print('Message',x,x+10) Déclaration des objets Objet

c. L'opération d'affectation

Type/nature

Sorties 2.Les types de données Entier int 15 Réel float 12.3 Booléen bool Caractère ---Chaine

str

True/False "A" / 'A' "Ok" / 'Ok'

Tableau (array) d’entier, réel, booléen

>>>from numpy import * >>> a=array([4,3,6]) Liste (list): b=[5,'bonjour',True]

x=15 x  15 x=x+1 xx+1 >>>b[0];b[2] z='Ok' z"Ok" 3. Les structures de contrôle conditionnelles  La structure de contrôle  La structure de contrôle conditionnelle généralisée conditionnelle simple Initialisation Initialisation Si Condition 1 Alors Traitement 1 Si Condition Alors Sinon Si Condition 2 Alors Traitement 2 Traitement1 Sinon ……………… Sinon Sinon Si condition N-1 Alors Traitement N-1 Traitement2 Sinon Traitement N opérations de base FinSi FinSi if condition : Traitement1 else : Traitement2

if condition1 : Traitement1 elif condition2 : Traitement2 else : Traitement3

Opérateurs: +, -, *, /, %, // Opérateurs puissance, valeur absolue, ... : **, pow, abs, ... Opérateurs de comparaisons :

= =, is, !=, is not, >, >=,

Get in touch

Social

© Copyright 2013 - 2024 MYDOKUMENT.COM - All rights reserved.