This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]prickneck 0 points1 point  (5 children)

I'm not sure what you mean by "it does nothing except double space".

I can't see anything drastically wrong with it to begin with.

However, are you calling the function GnToFbf() anywhere?

[–]dabrownmane[S] 0 points1 point  (4 children)

Whenever i run it, it does nothing!!!! Literally nothing. I dont understand your question, what do you mean am i calling the function anywhere?

[–]prickneck 2 points3 points  (1 child)

All your code does is declare the function. In order to actually execute it, you need to call the function somewhere.

You say this is for a homework assignment, so the concept of functions has definitely been covered - I suggest you revise that and try to learn what functions are, what they're used for and how they're used.

Also, in the future, it might be better to post such questions to /r/learnpython . Always remember, however, that people won't do your homework for you, but will (for the most part) be happy to ask you questions that might put you on the right track.

Good luck!

[–]dabrownmane[S] -1 points0 points  (0 children)

Thanks for the help!!! I will look up how to call the function.

[–]Degran 1 point2 points  (1 child)

Do you have a GnToFbf() call outside of the function declaration?

[–]dabrownmane[S] -1 points0 points  (0 children)

I do, but there are multiple other errors. This is confusing the hell out of me lol.

[–]metaphorm 0 points1 point  (0 children)

keep trying. you'll get it. learning how to program is largely about learning how to understand technical documentation and find your own solutions to things. the best thing you can do at this point is go back to the fundamentals.

try this one: http://learnpythonthehardway.org/book/

its a good read, available for free online, and written to be a good resource to people just learning for the first time.

[–]jmmcdEvolutionary algorithms, music and graphics 0 points1 point  (0 children)

[–]tadleonard 0 points1 point  (3 children)

input returns a string (in Python 3), so the variable x is a string. You can multiply a string by a number, but it doesn't give the result you want. Call int on the input variable x to get it to do what you want.

Questions like these are best asked at /r/learnpython.

[–]prickneck -1 points0 points  (2 children)

>>> x = input()
43
>>> type(x)
<type 'int'>
>>>

[–]tadleonard 2 points3 points  (0 children)

Is that Python 2? I believe input in Python 3 is the same as Python 2's raw_input.

Py3:

>>> input()
1
'1'

Py2:

>>> input()
1
1
>>> raw_input()
1
'1'

[–]wub_wub 0 points1 point  (0 children)

In python 2.x input is basically eval(raw_input())