Python Forum
divide a number iin two
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
divide a number iin two
#1
I got this easy homework but somehow i got stuck
i have to separte a number like: 1999 and math them as 19+19
I have done searches around but couldnt find this specif answear
if there is anyone to help
thanks in advance
Reply
#2
19 + 19, or 19 + 99?
use a slice
see: https://docs.python.org/3/tutorial/introduction.html
section on slicing/
Reply
#3
yes, it worked the way i wanted thank you so much
new to this. it's a little hard to where to find inf
hehehe thank you so much
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Divide a Python Turtle program into subprograms TurtleOHG 5 3,397 Mar-21-2020, 02:07 PM
Last Post: buran
  Divide a vector Langosmon 1 2,695 May-13-2018, 09:09 AM
Last Post: ThiefOfTime
  Divide a number - Multiple levels - Sum of all numbers equal to input number pythoneer 17 8,761 Apr-20-2018, 04:07 AM
Last Post: pythoneer
  Divide by 0 error kethyar 1 3,140 Jul-16-2017, 05:55 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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