10 Posted Topics
def T2(x): return x * 2 def dozen(): return T2('12') def enestrate(): return T2(3) print int (dozen()) + enestrate() I know it prints 1218 but i dont understand the code and the whole concept ... I used python to run it
I use python [CODE]How many function calls occur when this code is run? def A(): B() C() def B(): C() def C(): return B() A() The second question is what is the value of x after this code is run? x = 12 def A(): global x x = 5 …
[CODE]M = [[1,2,3], [4,5,6], [7,8,9]] x=0 for i in range(3): x = x + M[i][i] print x ------- M = [[1,2,3], [4,5,6], [7,8,9]] x=0 for i in range(3): for j in range(3): x = x + M[i][j] print x ---------- M = [[1,2,3], [4,5,6], [7,8,9]] x=0 for i in range(3): …
US --9--15--13--37 GE --10 --13--7--30 CA-- 14 -- 7 -- 5-- 26 (those dashes are meant to be spaces) How do i remove the first column of the text above so the output would look something like this? 9--15 --13 --37 10 --13--7--30 14 --7-- 5--26
I think we have the same assignment... I was battling with it also this morning during my tutorials. But to save your time, just use the new python that says turtle.setup(w,h). If you're in John Aycock's class, check his website for it. [QUOTE=jjrrmm;1176461]hi so for my project we were asked …
how do i create wall tiles like the one in the attachment below using turtle graphics in python and loops? sorry, i dont know how to post the picture directly :(
How do i make the grid on Turtle Canvas in python visible? Canvas size is 800 by 600
I have a python assignment that has to do with character occurrence. I have to extract all the characters (letters to be precise) in a poem and count how many of each letters there are. For an example: Bobby goes to school blahhhh blahhh blahhh To: B---6 o---5 y---1 ...etc …
I have the same assignment... but pls, how did you do the character occurrences using dictionary. I've been working my butts off to make my code work but no luck. [QUOTE=jjrrmm;1133830]Hi everyone. we have an assignment that asks us to count the number of occurrences in a piped raw input …
Hi... Pls, how do i do character occurrence using dictionary in python. I want to count the number of each characters in a poem like this .. A----25 G---10 etc...
The End.
Tops