/* Generating random number
*/
from random import randint
print(randint(0,5))
>>> # anyone from 0 to 5
For generating only 0 or 1
print(randint(0,1))
>>> 0 or 1
Best,
Bhanu Pratap
www.bhanubais.com
-Original Message-
From: Tutor [mailto:tutor-bounces+bha
Hi Rafeal,
You have called random function two times. It must be called single time and
check if it produced 1 or 2. See my code.
/* code
---*/
import random
print("""
This program flips a coin 10 times.
It then counts the number of heads and tails.
Hi Jim,
When you replace num = int(num); it's not changing a list.
Due to It only pick a value from a list.
You have to pointing to list so,
You have to use list[position] using while loop like below
listOfNumChars = list(str(intNum))
i = 0
while i < len(listOfNumChars):
listOfNumChars[i]