Question: is there a way to group up the count command for python, im new and want to shorten this code for num in counts: if
is there a way to group up the count command for python, im new and want to shorten this code
for num in counts: if num == 1: counts[1] = counts[1] + 1 if num == 2: counts[2] = counts[2] + 1 if num == 3: counts[3] = counts[3] + 1 if num == 4:
want to make it so it can be in 1 line of code and not 20 because i have to go until 21
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
