def myFunction(prices, credit):
for a in range(len(prices)):
for b in range(a+1,(len(prices))):
if(prices[a]+prices[b]==credit):
if (prices[a]>prices[b]):
myT=[prices[b],prices[a]]
return(myT)
else:
myT=(prices[a],prices[b])
return(myT)
Pre-conditions are the things that must be true before a method is
called.The method tells clients "this is what I expect from you".
Post-conditions are the things that must be true after the method is
complete. The method tells clients "this is what I promise to do for
you".
Invariants are the things that are always true and won't change.
The method tells clients "if this was true before you called me, I
promise it'll still be true when I'm done".
Public Function addSlash(ByVal temp As String)
If Microsoft.VisualBasic.Right(temp, 1) <> "\" Then
Return temp & "\"
Else
Return temp
End If
End Function
'VB6
Public Function addSlash(temp As String)
If Right(temp, 1) <> "\" Then
addSlash = (temp + "\")
Else
addSlash = temp
End If
End Function