473,416 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

split number on their counts in python

Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like 1,13,1,15,16,17

I am trying to code like

if linecnt == 12 :
numList = [int(digit) for digit in str(strsplit)]
print(numList)

however i m getting 1,2,1,3,1,4,1,5,`,6 ..

guyz any help plz..
Feb 6 '24 #1
1 30198
dev7060
636 Expert 512MB
I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like 1,13,1,15,16,17
What you mean by count?
4 Weeks Ago #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: nicolas | last post by:
Aim: scanf a number what random digit,split this number; for example: input "5680" output "5,6,8,0"; input "45" output "4,5";
11
by: Jay | last post by:
Hey Guys, I need an algorithm/formula to do the following: I have two 32-bit timers cascaded to form a 64-bit timer, max value per timer(50sec). This is the way they work: value | timer1 |...
7
by: skip | last post by:
A guy at work asked for functionality commonly found with rational numbers, so I said I'd find and install something. I figured gmpy would be suitable, alas I'm having trouble successfully...
9
by: Jason7899 | last post by:
hi, i have a number with 9 digits lenght and i want split this number: 922888222 into this: 922 888 222 how can i do that? thanks a lot for your help :)
5
by: Alex Hoilo | last post by:
Hello, I'm a novice to VBA and need to import raw data into an access database. I created the table, it contains 87 fields, all numeric. The data I have looks like this: ...
9
by: yasirassassin | last post by:
hey sir i am having problem in splitting a number into its digits if i use remainder and division operation then i can split a number and print it in reverse order but dont know how to split that...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.