try:
pos = name.find("#")
name = name[:pos]
except:
pass
try:
pos = name.find("TDCJ")
name = name[:pos]
except:
pass
Is there a way to combine these two try and except? My program keeps on building I feel like there is way too many try and excpet blocks. How do I avoid adding try and except often?
passthere is just for a more concise question here.