Home >Backend Development >Python Tutorial >Example introduction to Python2 random number sequence generator
This article mainly introduces the Python2 random number sequence generator, and analyzes the related implementation skills of Python based on the random module to operate random numbers in the form of simple examples. Friends in need can refer to the following
The examples of this article describe Python2 Random number sequence generator. Share it with everyone for your reference, the details are as follows:
#filename:randNumber.py import random while True: try: row=int(raw_input('Enter the rows:')) cols=int(raw_input('then Enter the cols:')) minNum=int(raw_input('then Enter the minNumber:')) maxNum=int(raw_input('then Enter the maxNumber:')) r=0 while r<row: line='' c=0 while c<cols: s=random.randint(minNum,maxNum) line+=str(s) line+=' ' c+=1 r+=1 print(line) except ValueError as err: print err
The above is the detailed content of Example introduction to Python2 random number sequence generator. For more information, please follow other related articles on the PHP Chinese website!