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 |
|
Re:
hi so for my project we were asked to ask the user to input a width and height for the dimensions of turtle screen. i asked for a user input then split it, and put in into a list then converted the two separate numbers into integers. so for example … |
|
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 … |
|
Re:
Hi everyone. we have an assignment that asks us to count the number of occurrences in a piped raw input text file and print it, calculate its phi statistic, the expected phi for english and the expected phi for random and then print them all out. also, at the end … |
|
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... |
0 Reputation Points
0 Endorsements
Ranked #13.1K
Ranked #3K
~3K People Reached
Favorite Forums
Software Development
x
11
Computer Science
x
5
Favorite Tags
python
x
11