python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Why do TextError exceptions not function properly in this code?
The code below output's "Do not divide by zero, that is forbidden" fine when the user inputs zero, however if a sentence or characters are entered it returns a ValueError. The error is as fo...
gurobot
Votes: 0
Answers: 1
How to search for an element and incase it does not exist search for another element using Selenium Python
I'm trying to search for an element and if it doesn't exist search for another element, and here is my code:
try:
elem1 = driver.find_element_by_xpath('xpath1')
elem = driver.find_element_by_x...
wezzo
Votes: 0
Answers: 1
is it safe to use the same variable name repeatedly in a series of functions?
Is it safe to re-use the same variable name repeatedly in a series of functions? My code is:
with open(thisdoc_dir + '/' + 'metadata.txt', 'w') as m:
m.write(str(metadatas[1]) + '\n')
m.close(...
Fred Zimmerman
Votes: 0
Answers: 1
Using Try Except to iterate through a list in Python
I'm trying to iterate through a list of NFL QBs (over 100) and add create a list of links that I will use later.
The links follow a standard format, however if there are multiple players with the same...
Zach
Votes: 0
Answers: 1