[ create a new paste ] login | about

Link: http://codepad.org/0Y1EZsnk    [ raw code | output | fork ]

Python, pasted on Nov 8:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import random

nbLig=int(input())
nbCol=int(input())
"""
def bernoulli(p):
    return random() < p
"""

rdmLign=random.randint(0,nbLig-1)
rdmCol=random.randint(0,nbCol-1)

carte = [["~" for _ in range(nbCol)] for _ in range(nbLig)]

carte[rdmLign][rdmCol] = "@"

for numLigne in range(nbLig):
    for numColonne in range(nbCol):
        print(carte[numligne][numColonne])
    print()
    


Output:
1
2
3
4
Traceback (most recent call last):
  Line 3, in <module>
    nbLig=int(input())
EOFError


Create a new paste based on this one


Comments: