473,421 Members | 1,412 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,421 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 30223
dev7060
638 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.