Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected result
#1
Os-Ubuntu 18.04 Python - Ver 3.6 Using Idle .

dms = input('DR_Lat (deg,min,sec,N/S/E/W) = ')
print(dms[0])
Output:
Output:
=============== RESTART: /home/linton/Documents/Python/test.py =============== DR_Lat (deg,min,sec,N/S/E/W) = 54,20,20 5
My expectation from the internet searches I have done is that the output for the index dms[0] should be the element before the first comma - in this case 54 but it only outputs the first digit 5 and not the whole indexed element.
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,696 Feb-04-2020, 08:31 AM
Last Post: Nesso
  Unexpected (?) result with regular expressions guraknugen 2 2,217 Jan-18-2020, 02:33 PM
Last Post: guraknugen
  Unexpected expected type error result MartinMaker 1 2,050 Feb-16-2019, 05:02 PM
Last Post: micseydel
  unexpected sub result after overloading operator jolinchewjb 1 2,279 Jan-24-2019, 08:23 AM
Last Post: buran
  Unexpected result eftimios 1 2,578 Dec-02-2018, 07:39 AM
Last Post: Gribouillis
  Unexpected result in simple prime number example jackhj 2 3,002 Apr-20-2018, 01:48 AM
Last Post: jackhj
  Reversing word in strings yields unexpected result Dec 4 3,643 May-17-2017, 05:32 PM
Last Post: wavic
  datetime unexpected result PickyBiker 10 9,106 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