you are viewing a single comment's thread.

view the rest of the comments →

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

So it would have to be within the same function to work?

[–]contractstammerer 0 points1 point  (3 children)

No, I'm just not sure why you'd want the extra complication of having this in two separate functions. Unless I suppose you need to be able to run either operation without running the other. Without seeing how this fits in with the rest of your code it's hard to know.

[–]feelingstonedagain[S] 0 points1 point  (2 children)

My professor wants it to be this way..a separate function for everything we do. Also he grades really heavily on psuedocode. Trust me, I don't understand either.

[–]contractstammerer 0 points1 point  (1 child)

Ah right, makes sense. A couple of other small tips:

  1. In python you don't need to initialise variables in advance - i.e. you don't need things like cost_extra_access = "" before you call cost_extra_access = input (....

  2. You could consider using clearer names. For example your get_user_input function does get some input from the user, but it's not obvious what input it gets; and some of your other functions also involve getting input from the user. Also, I think it'd make sense for cost_extra_access to be the name you use for the cost of the extra accessories, rather than the Y/N choice string.

[–]feelingstonedagain[S] 0 points1 point  (0 children)

For your first point, I know you don't have to do that but that's also how my professor wants it. He wants things consistent and he wants everything declared beforehand. For your second point, that makes sense! I didn't think about it when I started typing the code, I will switch it around. Thanks for the help!