Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slice list
#1
Hi

Im receving through serial a number from 0 to 511 and a letter like:

1 A
432 B
23 C

and I need to asign them to different variables. I try to slice the list but is not always the same index to cut at...

Any help..
Reply
#2
split()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Fix pandas copy/slice warning. deanhystad 3 757 Sep-07-2023, 03:18 PM
Last Post: deanhystad
  Slice creates new objects? fmr300 4 1,268 Jul-20-2022, 12:34 PM
Last Post: fmr300
  InvalidIndexError: (slice(None, None, None), slice(None, -1, None)) SuperNinja3I3 1 4,286 Jul-15-2022, 05:59 AM
Last Post: Larz60+
  increase and decrease a slice value? KEYS 2 2,055 Nov-10-2020, 11:35 PM
Last Post: KEYS
  Pass Tuple as a Slice nagymusic 2 2,320 Dec-12-2019, 04:42 AM
Last Post: nagymusic
  Preferred way to slice a list SvetlanaofVodianova 3 2,484 Dec-09-2019, 11:50 PM
Last Post: SvetlanaofVodianova
  slice python array on condition Gigux 2 2,229 Nov-03-2019, 07:21 PM
Last Post: Larz60+
  How to append and drop to next line while slice/indexing emryscass 3 2,554 Sep-26-2019, 01:06 PM
Last Post: Malt
  Understanding slice copying in for loop yksingh1097 5 3,965 Jul-02-2018, 01:03 PM
Last Post: yksingh1097
  Assigning to string slice michaeljhuman 1 2,730 Feb-08-2018, 12:57 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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