First time here? Check out the FAQ!
answered 2013-12-19 15:39:18 +0100
Second question: Depending on what you want, one of these should work.
sage: random()*2+1 2.6986168566690996 sage: randint(1,3) 1