Python Forum
Functions to get all latitudes given a list of listing_ids
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Functions to get all latitudes given a list of listing_ids
#4
Your function has one parameter, so you can pass it one argument like as follows.
def get_all_latitude(parameter1):
    print(parameter1)

get_all_latitude('first argument')
Output:
first argument
but you are trying to pass it two arguments and getting an error like below
def get_all_latitude(parameter1):
    print(parameter1)

get_all_latitude('first argument', 'second argument')
Error:
Traceback (most recent call last): File "c:/Users/Dave/Documents/VS Code WorkSpaces/Python Forum/general/forumpost2.py", line 32, in <module> get_all_latitude('first argument', 'second argument') TypeError: get_all_latitude() takes 1 positional argument but 2 were given
You should either only be passing one argument or add another parameter to your function like below
def get_all_latitude(parameter1, parameter2):
    print(parameter1, parameter2)

get_all_latitude('first argument', 'second argument')
Output:
first argument second argument
Reply


Messages In This Thread
RE: Functions to get all latitudes given a list of listing_ids - by Yoriz - Jun-14-2019, 01:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Functions returns content of dictionary as sorted list kyletremblay15 1 2,022 Nov-21-2019, 10:06 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020