'funtion return not passing through to another function
i'm trying to pass the variable which is a user input from one function through to the next function, im getting the error that the function initiateWD is missing the gamecode argument
def joinLobby():
print('Enter game code:')
gamecode = str(input().upper())
return gamecode
def initiateWD(gamecode):
driver = webdriver.Chrome(executable_path=ChromeDriverManager().install())
driver.set_window_size(600, 500)
driver.get("https://jklm.fun/{}".format(gamecode))
Solution 1:[1]
You didn't share how you called initiateWD function.So based on your question,here is my solution --
def joinLobby():
print('Enter game code:')
gamecode = str(input().upper())
return gamecode
def initiateWD(gamecode):
driver =
webdriver.Chrome(executable_path=ChromeDriverManager().install())
driver.set_window_size(600, 500)
driver.get("https://jklm.fun/{}".format(gamecode))
initiateWD(joinLobby())
Here joinLobby function is called and pass to initiateWD as a parameter.The function called with initiateWD(joinLobby) - here the joinLobby function passing as parameter ,so in initiateWD you have to called joinLobby() first to get the gamecode
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
