Python random number excluding one variable -


is possible create variable random number except 1 number stored in variable?

for example:

import random x = raw_input("number: ") y = random.randint(1,6) 

so variable x never y

try this:

import random  x = int(raw_input("number(1-6): ")) # note made x int  while true:     y = random.randint(1, 6)     if x != y: break 

Comments

Popular posts from this blog

ubuntu - How to disable Kernel Module Signing in linux -

java - Ebean enhancement ignores a model -

How to combine associative arrays in bash? -