python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How to handle Index Error in Tuple Exception in Python?
So I have the follwowing Code:
try:
pygame.mixer.music.load(songs[index])
pygame.mixer.music.play()
check_event()
except:
("IndexError: tuple index out of range")
mess...
baumanager
Votes: 0
Answers: 1
Bypassing ValueError in a for loop in python
def decade_total_count(decade, name):
"""
sums up the number of births of the given
female baby `name` in a 10-year period
Parameters:
~~~~~~~~~~~~~~~~~~~~~~~~...
vlaaaaaddd
Votes: 0
Answers: 2
Is it possible to catch None in except statement?
I'm working on a program that represents a month in number.
Each month name and number are stored in a dictionary, with the key being the month name.
The program needs to take the month name as input ...
Python learner
Votes: 0
Answers: 1
A Python try/except function to rule them all (with different inputs) is possibile?
I'm trying to define in Python a try/except function that can handle various other function.
The idea is quite this one:
def func1(x,y):
z = x+y
return z
def error_check(func1):
try: ...
Stefano Pellegrini
Votes: 0
Answers: 2