Re: Problem with the "for" loop syntax

2013-06-19 Thread Arturo B
Mmmm Ok guys, thank you I'm really sure that isn't a weird character, it is a space. My Python version is 3.3.2, I've runed this code in Python 2.7.5, but it stills the same. I've done what you said but it doesn't work. Please Check it again here is better explained: http://snipplr.com/v

Re: Problem with the "for" loop syntax

2013-06-19 Thread Arturo B
Sorry, I'm new in here So, if you want to see the complete code I've fixed it: http://www.smipple.net/snippet/a7xrturo/Hangman%21%20%3A%29 And here is the part of code that doesn't work: #The error is marked in the whitespace between letter and in def displayBoard(HANGMANPICS, missedLetters,

Re: Problem with the "for" loop syntax

2013-06-19 Thread Arturo B
Fixed, the problem was in HANGMANPICS I didn't open the brackets. Thank you guys :) -- http://mail.python.org/mailman/listinfo/python-list

How is this evaluated

2013-07-04 Thread Arturo B
I'm making this exercise: (Python 3.3) Write a function translate() that will translate a text into "rövarspråket" (Swedish for "robber's language"). That is, double every consonant and place an occurrence of "o" in between. For example, translate("this is fun") should return the string "tothoh

Bug asking for input number

2013-11-15 Thread Arturo B
Hi! I hope you can help me. I'm writting a simple piece of code. I need to keep asking for a number until it has all this specifications: - It is a number - It's lenght is 3 - The hundred's digit differs from the one's digit by at least two My problem is that I enter a valid number like: 123, 32

Re: Bug asking for input number

2013-11-15 Thread Arturo B
MRAB your solution is good thank you I will use it. Terry Eddy I saw my mistake about for example 2 <= 2, I think it's easier to use break in this case thank you! -- https://mail.python.org/mailman/listinfo/python-list

How is this list comprehension evaluated?

2013-09-16 Thread Arturo B
Hello, I'm making Python mini-projects and now I'm making a Latin Square (Latin Square: http://en.wikipedia.org/wiki/Latin_square) So, I started watching example code and I found this question on Stackoverflow: http://stackoverflow.com/questions/5313900/generating-cyclic-permutations-reduced-la

Understanding how is a function evaluated using recursion

2013-09-25 Thread Arturo B
Hi, I'm doing Python exercises and I need to write a function to flat nested lists as this one: [[1,2,3],4,5,[6,[7,8]]] To the result: [1,2,3,4,5,6,7,8] So I searched for example code and I found this one that uses recursion (that I don't understand): def flatten(l): ret = [] for i