Thank you for providing an example on non-working code, I confirm that it
is not working for me as well. The problem seems to be with JSON parsing
inside the browser, no request is sent to the permalink server. I will try
to figure out what is going on tomorrow or this weekend.
Best,
Andrey
On Wednesday, 20 November 2019 20:38:25 UTC-7, Jorge Garcia wrote:
>
> I just tried making a permalink from the following code snippets at home,
> but no joy either! Is there something about this code that cannot be
> converted to a permalink? Take a look:
>
> #CSH304 More About Pythonic Functions! MrG
> show('#1) concatenate 2 strings')
> def concat(s1,s2):
> return s1+' '+s2
> show('concat("al","garcia")=',concat("al","garcia"))
> show('')
> show('#2) draw a house!')
> def printHouse():
> print(" /\\\n/__\\\n| |\n|__|")
> #print(" /\\")
> #print("/__\\")
> #print("| |")
> #print("|__|")
> printHouse()
> show('')
> show('#3) pad your strings!')
> def rightJustify(s,w):
> 'pad s with correct number of spaces in front'
> return ' '*(w-len(s))+s
> show('#3) rightJustify("bob",7)=',rightJustify("bob",7))
> show('')
> show("#4a) what's wrong with this output?")
> def print10Stars():
> print 10*'*'
> show('#4a) print10Stars()=',print10Stars())
> show('')
> show('#4b) how to get rid of None?')
> def make10Stars():
> return 10*'*'
> show('#4b make10Stars()=',make10Stars())
> show('')
> show('#5) predict the output')
> def printTriangle(n,ch):
> while n>0:
> show(n*ch)
> n-=1
> return 1
> show("#5) printTriangle(2,'*')=",printTriangle(2,'*'))
> show("#5) printTriangle(3,'#')=",printTriangle(3,'#'))
>
> show("printTriangle(2,'*')+printTriangle(3,'#')=",printTriangle(2,'*')+printTriangle(3,'#'))
> show('')
> show('#6) predict the output')
> def sum1ToN(n):
> if n>0:
> return n*(n+1)//2
> show('sum1ToN(6)=',sum1ToN(6))
> show('sum1ToN(0)=',sum1ToN(0))
> show('sum1ToN(-3)=',sum1ToN(-3))
> show('')
> show('#8) what is the output?')
> #show('#8) len(0)=',len(0))
> show("#8) len('0')=",len('0'))
> show("#8) len('''0''')=",len('''0'''))
> show("#8) len('''''')=",len(''''''))
> show('#8) len([0])=',len([0]))
> show('#8) len([])=',len([]))
> #show('#8) len((0))=',len((0)))
> show('#8) len(range(0)=',len(range(0)))
>
--
You received this message because you are subscribed to the Google Groups
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-cell/4419462f-b138-4c0e-8c09-25563dee4477%40googlegroups.com.