TheAnointedOne
Superstar
[redacted]
Last edited:
Everybody and their grandmom trying to be a programmer lol. It's going to be oversaturated like nursing and onlyfans thotology.
Everybody and their grandmom trying to be a programmer lol. It's going to be oversaturated like nursing and onlyfans thotology.
can you share some examples here?
def has_33(nums):
for i in range(0,len(nums)-1):
if nums[i] == 3 and nums[i+1] == 3:
return True
else:
return False
Here is a example of a question that I had a issue with before I was able to find the answer.
Given a list of ints, return True if the array contains a 3 next to a 3 somewhere.
has_33([1, 3, 3]) → True
has_33([1, 3, 1, 3]) → False
has_33([3, 1, 3]) → False
Code:def has_33(nums): for i in range(0,len(nums)-1): if nums[i] == 3 and nums[i+1] == 3: return True else: return False
I understand using the if/else statements, having the value ==3 and the true/false booleans. I think my issue is that I still not grasping the concept of the for loops and putting the pieces together to get the code to work.
Nursing is a high demand job because not everyone is built to deal with old and sickly people. That why they get paid a lot of money because shyt is stressful and people get burnt out by it and leave.Everybody and their grandmom trying to be a programmer lol. It's going to be oversaturated like nursing and onlyfans thotology.
Your explanation made more sense. I may need to go back on certain topics to make sure that I understand them. Thanks for the help.when you're using a for loop to iterate over a list of items, you're doing something to one at a time until you've checked the entire list. in the case of determining whether there are consecutive 3's in a list we start with a random list. let's take the first example. [1, 3, 3]
in our for loop, each i represents the index value of the list, if the list contains three values, the indices are 0, 1, 2 which maps to 1, 3, 3 in our list example.
on the first pass of the loop i = 0 we get the list value with bracket notation list is equal to 1. now that we have the first value we want to check two things:
in the first loop list is equal to 1 so it doesn't make sense to check what the next value is yet as it's not equal to 3 and we'll find out on the next loop.
- Is the value equal to 3
- Is the value after it also equal to 3
in the second loop list is equal to 3 so our first condition has been met we want to check what the next value is and we can do this by adding i+1
list[i+1] = 3, we want to return true because both conditions have been met.
nah..my lady is a nurse....when she had static at the hospital she was working full time at, she was able to find a new gig quickly...and stay on at the old hospital as per diemEverybody and their grandmom trying to be a programmer lol. It's going to be oversaturated like nursing and onlyfans thotology.
Spent about 90 minutes "debugging" an assignment only to finally notice I forgot a single closing }
That’s why employers are becoming more demanding - to weed out the good programmers from the wannabesEverybody and their grandmom trying to be a programmer lol. It's going to be oversaturated like nursing and onlyfans thotology.
Spent about 90 minutes "debugging" an assignment only to finally notice I forgot a single closing }
If you aren't a part of those groups in the 4th bullet point, don't even waste your energy