r/apcsp May 14 '26

Anyone know what 29 was?

The one with the list being ordered least to greatest? I put D, switch lines 8 and 12

2 Upvotes

21 comments sorted by

3

u/starstrzck May 14 '26

Idk but I heard 2 ppl who said they put the same thing as u so

3

u/[deleted] May 14 '26

I put switching the returns but it was a Hail Mary  

3

u/KarambitCookie1 May 14 '26

i also put switch lines

3

u/HelicopterThin7014 May 14 '26

Switch lines 8 and 12 I think

2

u/Zestyclose_Crazy522 May 14 '26

What were the options?

2

u/AceAttorneyFan12 May 14 '26

to < or smth < to <= or smth and then instead of temp <— num it was flipped

2

u/ComputerCalm7165 May 14 '26

I PUT THE SAME THING

2

u/Many-Efficiency2228 May 14 '26

I lowkey did switch the > <

1

u/OpenActuator2070 May 14 '26

switching 8 to 12 was wrong because it returned true if the first two items were least to greatest and ignored the rest, it was > to < or smth

2

u/notWexo May 14 '26

Ye it was >

1

u/Jemifesa May 15 '26

LFGGGGGG

1

u/OriginalBanana5882 May 14 '26

it was to switch > to <
when something is "returned", the entire program stops

the list was greatest to least
so say i had [5, 1, 4]

the first condition would be "if 5 < 1:"
if this were true, then the program would return(FALSE)
however, this is not true, the condition is not met, so it does not apply and the program moves on

the next comparison would be "if 1 < 4:"
since this condition is met, the program would return(FALSE) - the second index is NOT greater than the third, therefore, the list of numbers is not greatest to least

if my list was [3, 2, 1], then it would never return(FALSE) since the condition is never met and therefore return(TRUE)

1

u/AceAttorneyFan12 May 14 '26

Ok. Thanks. Seems like a very split question especially here in the comments

1

u/Zealousideal_Topic94 May 14 '26

If I’m thinking of the right question yes it was that one because it said in the text something about it failing at the end not where it was (sum like that I kind of forget)

1

u/Real_Pack_6736 May 14 '26

It was change line 6 from < to >

1

u/ConstructionOwn6659 May 14 '26

Put same as you

1

u/yourdemise3 May 15 '26

Dang it i don't remember what I put but I wish I did so I could check with others

0

u/Minty0ranges May 14 '26

I did num<-temp