[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 84 KB, 500x500, 1318809090798.png [View same] [iqdb] [saucenao] [google]
5618930 No.5618930 [Reply] [Original]

Programming noob here.
I'm having a problem with Python. I defined a function, but when I type that function, the help popup it displays is for the int() function, not the one I defined, and when I try executing the program, it throws TypeError: 'int' object is not callable at the line where I called my function. What do I do?

>> No.5618946

>>5618930
You're gonna need to give us a bit more than that, dumbass.
Perhaps...code?

>> No.5618968

Show us your code....

also >>>/g/ is better for this stuff.

>> No.5618988

Good and bad news. Good news is I got it to work. Bad news is it still shows the wrong info. I'm using IDLE.
How do you post code here? (as in )

>> No.5618991 [DELETED] 

>>5618988
just paste it python isnt exactly hard to read

>> No.5618992

>>5618988
>How do you post code here
http://codepad.org/
http://pastebin.com/

>> No.5618996
File: 48 KB, 750x600, 1201210916384.jpg [View same] [iqdb] [saucenao] [google]
5618996

>>5618991
>just paste it python isnt exactly hard to read
>python WITHOUT any of it's indentation

>> No.5619010

http://codepad.org/Ec6kXyPc
The problem happened when I typed toque(
It would show int() info instead.
The program is part of a homework, that's why it's so impractical, it has to be made that way.
It's a game of "Toque y fama" (dunno the name in english), which is about guessing a randomly generated number using hints given (if the number you tried has any of the digits the secret number has, or if it has the right digits in the right places)

>> No.5619100

>>5619010
>dunno the name in english
http://en.wikipedia.org/wiki/Bulls_and_cows

>> No.5619137

>>5619010
dude spanish programming is fucking funny

>> No.5619140

>>>/g/

>> No.5619158

>>5619010
>http://codepad.org/Ec6kXyPc
line 131 you could just say

if 1<=n<=9 : break;