Python Forum
How to make a subtraction within a range of numbers?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a subtraction within a range of numbers?
#4
result = 10
for number in range(4):
    result -= number
print(result)
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: How to make a subtraction within a range of numbers? - by ichabod801 - May-08-2017, 09:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  forloop to compute sum by alternating from addition to subtraction JulianZ 3 1,933 Apr-02-2022, 09:36 AM
Last Post: DeaD_EyE
  nsimplify, make zero the really small numbers in the matrix quest 5 1,755 Jan-19-2022, 11:41 PM
Last Post: quest
  matplotlib x axis range goes over the set range Pedroski55 5 3,373 Nov-21-2021, 08:40 AM
Last Post: paul18fr
  List index out of range error when attempting to make a basic shift code djwilson0495 4 3,109 Aug-16-2020, 08:56 PM
Last Post: deanhystad
  How to make this function general to create binary numbers? (many nested for loops) dospina 4 4,585 Jun-24-2020, 04:05 AM
Last Post: deanhystad
  Odd numpy error with subtraction DreamingInsanity 5 2,836 Jun-01-2020, 02:49 PM
Last Post: DreamingInsanity
  Return prime numbers from range krzyfigh 2 2,005 Apr-20-2020, 08:08 PM
Last Post: krzyfigh
  Define a range, return all numbers of range that are NOT in csv data KiNeMs 18 7,355 Jan-24-2020, 06:19 AM
Last Post: KiNeMs
  Basic subtraction error rix 4 3,506 Oct-11-2019, 06:43 AM
Last Post: buran
  Print Numbers starting at 1 vertically with separator for output numbers Pleiades 3 3,854 May-09-2019, 12:19 PM
Last Post: Pleiades

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020