Latest web development tutorials

Python comprend des exercices 50

Python 100 Li Python 100 Li

Titre: sortie un nombre aléatoire.

Analyse du programme: en utilisant le module aléatoire.

Source Code:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

import random

#生成 10 到 20 之间的随机数
print random.uniform(10, 20)  

L'exemple ci-dessus sortie est:

14.4012371357

Python 100 Li Python 100 Li