RE: First program help 02-22-2014, 09:57 PM
#12
(02-22-2014, 08:53 PM)PrimeD Wrote: I tried adding random but for the following error
line 11, in <module>
weird = random.randint(1, 100)
NameError: name 'random' is not defined
Code:age = int(input('How old are you: ')) weird = random.randint(1, 100) oldage = sum(age + weird)
what did I do wrong?
you need to import random library, just add this at the top of your code:
Code:
import randomHappy Coding
![[Image: wvBFmA5.png]](http://i.imgur.com/wvBFmA5.png)


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)