Hey there: I have a list with two random numbers. For example a = [4,9] I want to overwrite the lower number with another number. Is there a easier way instead of: a[a.index(min(a))] = 14 Thanks for your help:)
Easier or not, this is quite interesting: a[a>a] = 14 NOTE: This only works for lists with n=2 numbers. For n>2 use your approach.
For a beginner like me, the only way I know: a.sort() a=14
a = 14 Sorry I don't know more
a = 14
This list operations are like hell for me. It’s sooo confusing 🙈
Yeah you can in this way for i in a: if(a>a) min=a else min=a Then assign the value to min And this code works
What i do wrong ?
Please rearrange int array:
Locked out by Rocket Icon
Помогите с кодом автобуса