Not Yet Answered # slicing help

richieking 44 Thisisnotanid

0

Slice what? which part???? can you please provide more info and any code you have .

:)

0

Let's say you have the array as a list. Here's a possible solution:

```
# This solution's assuming you have values for bounds that match values in the range you have.
T = range(0, 101) # Arbitrary list of temperatures.
T1 = 5 # Arbitrary first lower bound.
T2 = 35 # Arbitrary first upper bound.
T3 = 50 # Arbitrary second lower bound
T4 = 75 # Arbitrary second upper bound
# Slicing is as follows:
T1s = T[T.index(T1): T.index(T2) + 1] # First sub-list containing temperatures in the first range, inclusive.
T2s = T[T.index(T3): T.index(T4) + 1] # Second sub-list containing temperatures in the second range, inclusive.
# The following solution's assuming you don't have values for bounds that match values in the range you have, but you still want temperatures in that range. It uses the same naming convention as above.
T = range(0, 101) # Arbitrary list of temperatures.
T1 = 5 # Arbitrary first lower bound.
T2 = 35 # Arbitrary first upper bound.
T3 = 50 # Arbitrary second lower bound
T4 = 75 # Arbitrary second upper bound
# But now let's assume T1, T2, T3, and T4 aren't in T. So:
x = T[0]
while x < T1:
for m in T:
if m > T1:
T1 = m
x = m
y = T[len(T) - 1]
while y > T2:
for m in T:
if m < T2:
T2 = m
y = m
# The process will be the same for T3 and T4. Then:
T1s = T[T.index(T1): T.index(T2) + 1] # First sub-list containing temperatures in the first range, inclusive.
T2s = T[T.index(T3): T.index(T4) + 1] # Second sub-list containing temperatures in the second range, inclusive.
```

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

get the input from user may include

-Bank balance

-Amount invested in business

-Amount given to other business partners as loan

and

-Amount payable to others

Made this in cpp.sh

Why would I need the x=y+1-1;?

x=y; just doesnt seem to work

Why is this?

And I know my coding ...

there are five tables (personTb, addressTb,churchTb) each holds data pertinent to an individual; (personAddress,personChurch) each hold the primary key for the person table and corresponding table IE personAddress holds primary key for addressTb.

both snippets work, my question is;** Is my join correctly formatted? **

```
select
concat(personTb.p_fName,' ',personTb.p_mName,'. ',personTb.p_lName) ...
```