Skip to main content
Commonmark migration
Source Link

Python 2, Python 3, 41 bytes

i,j=input(),input()
while j>0:i=-~i;j=~-j

#Python 2, Python 3, 41 bytes i,j=input(),input() while j>0:i=-~i;j=~-j If using the - number operator is allowed.


Python 2, Python 3, 40 bytes

i,j=input(),input()
while j>0:i=-~i;j-=1

#Python 2, Python 3, 40 bytes i,j=input(),input() while j>0:i=-~i;j-=1 If using the - number and literal -= number operators is allowed.


Works on positive integers. Takes a and b and prints a+b.

#Python 2, Python 3, 41 bytes i,j=input(),input() while j>0:i=-~i;j=~-j If using the - number operator is allowed.


#Python 2, Python 3, 40 bytes i,j=input(),input() while j>0:i=-~i;j-=1 If using the - number and literal -= number operators is allowed.


Works on positive integers. Takes a and b and prints a+b.

Python 2, Python 3, 41 bytes

i,j=input(),input()
while j>0:i=-~i;j=~-j

If using the - number operator is allowed.


Python 2, Python 3, 40 bytes

i,j=input(),input()
while j>0:i=-~i;j-=1

If using the - number and literal -= number operators is allowed.


Works on positive integers. Takes a and b and prints a+b.

Source Link
Erik the Outgolfer
  • 40.6k
  • 5
  • 45
  • 122

#Python 2, Python 3, 41 bytes i,j=input(),input() while j>0:i=-~i;j=~-j If using the - number operator is allowed.


#Python 2, Python 3, 40 bytes i,j=input(),input() while j>0:i=-~i;j-=1 If using the - number and literal -= number operators is allowed.


Works on positive integers. Takes a and b and prints a+b.