answered 11 years ago
Second question: Depending on what you want, one of these should work.
sage: random()*2+1 2.6986168566690996 sage: randint(1,3) 1