I have a value to check in the list range
Example:
recipies = int(input("enter:"))
print(recipies)
interval =[]
for i in range(recipies):
x = (input().split())
interval.append(x)
print(interval)
agroup =int(input("enter:"))
print(agroup)
qali = []
for i in range(agroup):
x = (input().split())
qali.append(x)
print(qali)
for cmp in qali:
toa = cmp[1:]
Input:
4
1 4
3 10
2 6
5 8
3
1 5
2 2 6
3 1 10 9
Output:
3
4
2
Here i want to check weather the value of toa available in the interval if available i want to print how many times that value available in the given intervals,same way i want to check values in quali(list)
Copyright Notice:Content Author:「sreeks devan」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30508243/how-to-check-a-value-in-a-list-value-range-in-python