You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%form
Enter an integer n=300
Enter a prime p=2
Show prime factors only primes=False
Operate on primes op=
* sum
* product
{{{
v = factor(n%p)
if primes:
for i in v:
print i[0]
else:
for i in v:
print "%d**%d"%i
if op == "sum"
print "Sum of prime factors"
s = 0
for i in v:
s += i[0]*i[1]
print s
if op == "product"
print "Product of distinct prime factors"
s = 1
for i in v:
s *= i[0]
print s
}}}
The above would make an interactive widget which would make an input form for the variables used in the code block. A submit button would read the input fields and display output from the code.
Example:
The above would make an interactive widget which would make an input form for the variables used in the code block. A submit button would read the input fields and display output from the code.
Component: notebook
Issue created by migration from https://trac.sagemath.org/ticket/137
The text was updated successfully, but these errors were encountered: