Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected result
#3
your expectation would be true, if dms was list, but it is not. It is a str.
you need to split the str returned by input(). Note that dms[0] will still be str.
dms = input('DR_Lat (deg,min,sec,N/S/E/W) = ').split(',')
print(dms[0])
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Unexpected result - by linton - May-02-2020, 12:44 PM
RE: Unexpected result - by ndc85430 - May-02-2020, 12:50 PM
RE: Unexpected result - by buran - May-02-2020, 12:51 PM
RE: Unexpected result - by anbu23 - May-02-2020, 01:00 PM
RE: Unexpected result - by linton - May-02-2020, 01:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  list sum gives unexpected result Nesso 0 1,685 Feb-04-2020, 08:31 AM
Last Post: Nesso
  Unexpected (?) result with regular expressions guraknugen 2 2,204 Jan-18-2020, 02:33 PM
Last Post: guraknugen
  Unexpected expected type error result MartinMaker 1 2,040 Feb-16-2019, 05:02 PM
Last Post: micseydel
  unexpected sub result after overloading operator jolinchewjb 1 2,259 Jan-24-2019, 08:23 AM
Last Post: buran
  Unexpected result eftimios 1 2,559 Dec-02-2018, 07:39 AM
Last Post: Gribouillis
  Unexpected result in simple prime number example jackhj 2 2,984 Apr-20-2018, 01:48 AM
Last Post: jackhj
  Reversing word in strings yields unexpected result Dec 4 3,621 May-17-2017, 05:32 PM
Last Post: wavic
  datetime unexpected result PickyBiker 10 9,073 Dec-27-2016, 10:47 PM
Last Post: PickyBiker

Forum Jump:

User Panel Messages

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