Home Python Quizz Python - 1) Entrée / Sortie

Menu principal

Informatique

Mathématiques

Quizz Python - 1) Entrée / Sortie
Informatique - Python
Écrit par Arnaud Kientz   
Index de l'article
Quizz Python
1) Entrée / Sortie
2) Variables
3) Structures conditionnelles
4) Fonctions
Toutes les pages

Entrée / Sortie

 

Pour tout ce paragraphe on a a = 2 et b = 3.

 

  1. Que va afficher la commande print a, b ?

    1. 2, 3

    2. 2 3

    3. 2
      3

    4. a, b

    5. a b

    6. a
      b

  1. L'affichage suivant est-il correct ?
    print 'Voici', 'un', 'texte'

  2. L'affichage suivant est-il correct ?
    print 'Voici un texte\n'

  3. Que va afficher la commande print a * b ? La commande print a ** b ? La commande print a < b ?

  4. Comment afficher le texte « C'est un texte d'aujourd'hui. » ?

  5. Que va afficher le code suivant ?
    blabla = raw_input('Entrez un truc')

    print type(blabla)

  6. Trouver l'erreur dans le code suivant et proposer deux solutions :
    nombre = raw_input('Entrez un nombre')
    print nombre + 2

  7. Que va afficher le programme suivant ?
    a = input("Entrez un nombre :\n")
    b = 15
    c = 25
    d = 27
    print c / 5
    a = a – a
    c = c + 1
    d = d – c
    b = 2 * b
    print d – 1, b % 4, a + 1
    print c * 10, b * 3 + d * 10



Mise à jour le Dimanche, 11 Octobre 2009 12:37