d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Python Q
Add Reply New Topic New Poll
Member
Posts: 31,591
Joined: Nov 17 2007
Gold: 931.00
Oct 17 2012 12:12am
halp

Assume that the grader defines two variables A and B for you. Write a program which prints out the value

min(A, B )

However, there is a catch: your program is not allowed to use the min function. Instead, use max in a clever way to simulate min.


im stumped qq

e/ print(max(-A,-B)*-1)
figured it out :)

This post was edited by lilpsychokilla on Oct 17 2012 12:26am
Member
Posts: 161,550
Joined: Oct 18 2006
Gold: 4.03
Warn: 20%
Oct 17 2012 01:41am
http://code.google.com/edu/languages/google-python-class/

good class, maybe it'll learn you something or someone else.. it learnt me a bit
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll