0
Functions in python code
https://code.sololearn.com/c59pJNfW4Lv0/?ref=app In that code Iâm trying to call functions so that it enables a user to insert a command when it prompts for a command. The calling functions part is what is getting me messed up here. Help me with my code.
6 Answers
+ 1
The code structure seems to be wrong.
command=int(input("Enter command:")) belongs in main()
if command == RETURN_BOOK, the function return_book(books) needs to be called.
return_book() needs a parameter "books" so you need to ask which book is returned before you can call the function
return returned_book doesn't seem to make sense (but it's not necessarily wrong)
=> same for all other functions
0
so how would it look like?
0
i called it at the bottom but doesnt seem right to me cause it calls them order which is not what i want.
0
they should call the functions randomly depending what the user types as a command
0
well the code is suppose to be divided into 8 functions