I've been following a tutorial which is relatively simple, but for some reason the view doesn't seem to reflect my html file, it's probbaly something simeple but being new to web2py I can't see what I'm doing wrong - any help appreciated
Andy
This is my controller basics.py
# -*- coding: utf-8 -*-
import random
def isPrime(num):
counter = 2
while counter < num-1:
if num%counter==0:
return False
counter = counter + 1
return True
def random_number():
x = random.randint(3,20)
result = isPrime(x)
return locals()
This is my view random_number.html
{{extend 'layout.html'}}
<h1>Random Number</h1>
<h3>
Is the random numnber, {{=x}}, prime?
</h3>
<h3>
The answer is: {{=result}}
</h3>
This is my result:
This is what I am expecting: