Go to advanced search

by Pix-IE
Tue Mar 31, 2015 8:16 am
Forum: Python
Topic: Battleship! + a couple of other questions
Replies: 11
Views: 2060

Re: Battleship! + a couple of other questions

It seems the solution you just mentioned finally worked! The code sorted out the list as well, as it should have.

My humble thanks to you all for your patience and helpful advices!
by Pix-IE
Sun Mar 29, 2015 9:07 am
Forum: Python
Topic: Battleship! + a couple of other questions
Replies: 11
Views: 2060

Re: Battleship! + a couple of other questions

I now actually removed filmlist.txt -file just in case, leaving Filmlist.py left (which contains exactly the same content as filmlist.txt), but the code error Traceback (most recent call last): File "/home/pi/.idlerc/Films.py", line 10, in <module> with open("filmlist", "r") as file: IOError: [Errno...
by Pix-IE
Fri Mar 27, 2015 10:39 pm
Forum: Python
Topic: Battleship! + a couple of other questions
Replies: 11
Views: 2060

Re: Battleship! + a couple of other questions

Yay, it seems with the advice you've given me for performing Battleship on Python 3, the code ran! Thank you. As for the second issue (which still persists), I got the following result: Artistic.py Factors2.py Fibonacci.py Films.py Mastermind.py Battleship.py Factors3.py Filmlist.py hei.py recent-fi...
by Pix-IE
Tue Mar 24, 2015 10:02 am
Forum: Python
Topic: Battleship! + a couple of other questions
Replies: 11
Views: 2060

Re: Battleship! + a couple of other questions

I think I know more or less how functions work but when I attempted to do as you said in Python 3, that is, bracketing every single print (I bracketed even quoted sentences like "Congratulations! You sank my battleship!"), but now that I've done that (I also made sure about the int(input) -situation...
by Pix-IE
Sat Mar 21, 2015 11:16 am
Forum: Python
Topic: Battleship! + a couple of other questions
Replies: 11
Views: 2060

Re: Battleship! + a couple of other questions

Very well, thank you for the answer. The Battleship-code indeed seems to work in Python 2, but in Python 3, despite performing the apparent changes you showed me, the code still says "Source code: Invalid syntax" and paints the background of the righthand " -character red here: print " ".join(row) T...
by Pix-IE
Fri Mar 20, 2015 9:11 pm
Forum: Python
Topic: Battleship! + a couple of other questions
Replies: 11
Views: 2060

Battleship! + a couple of other questions

Greetings again! In order to get a better grasp from Python, I've decided to learn it via Codecademy -website. So far, I'm now in the part where I've coded Battleship-game and have to try it out multiple times, but here's the problem: when I put up the code to Python3 in RasPi, it says "Invalid synt...
by Pix-IE
Sat Feb 21, 2015 7:15 pm
Forum: Python
Topic: Could somebody help a Python amateur out here, please?
Replies: 9
Views: 1792

Re: Could somebody help a Python amateur out here, please?

Holy moe, it worked! It seems just like Sleep Mode zZ mentioned, I had to choose the indentations either by Tab or Space, not both in the same code.

Thanks for the help you've given me, all of you! ^.^ Hopefully I can still develop in this area!
by Pix-IE
Sat Feb 21, 2015 4:22 pm
Forum: Python
Topic: Could somebody help a Python amateur out here, please?
Replies: 9
Views: 1792

Re: Could somebody help a Python amateur out here, please?

It seems that by writing "python3 factors.py" the situation has moved on a bit, but still, after I write it down, the following happens: pi@raspberrypi ~ $ python3 factors.py File "factors.py", line 7 factors+=1 ^ TabError: inconsistent use of tabs and spaces in indentation pi@raspberrypi ~ $
by Pix-IE
Sat Feb 21, 2015 3:37 pm
Forum: Python
Topic: Could somebody help a Python amateur out here, please?
Replies: 9
Views: 1792

Re: Could somebody help a Python amateur out here, please?

I see, my apologies. Although I think it will be enough if I just send the codes here, without pics. The code above reads as for number in range(1, 51): print(number, ":", end=" ") for divisor in range(1, number+1): if number%divisor == 0: print(divisor, end=" ") print() and the code below reads as ...
by Pix-IE
Sat Feb 21, 2015 10:52 am
Forum: Python
Topic: Could somebody help a Python amateur out here, please?
Replies: 9
Views: 1792

Could somebody help a Python amateur out here, please?

Greetings! I recently started testing Python and tried to go on with it by Raspberry Pi Education Manual, but now I'm stuck with the part where I'm seemingly supposed to create Python Shell program via LXTerminal's "nano" program. I opened up via "nano" program the "factors.py" -file, which containe...

Go to advanced search