is the file in controllers/basic/random_number.html ?

On Thursday, 3 October 2019 20:32:05 UTC-7, Andy W wrote:
>
> 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:*
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/675d3c9a-e1d8-46dc-b448-4974f248deba%40googlegroups.com.

Reply via email to