473,396 Members | 1,852 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,396 software developers and data experts.

how to print digits with space?

In my homework i need to write a function that inputs and integer between 1 and 32767 and prints it as a series of digits, each pair of which is separated by two spaces. for example 3412 should print as : 3 4 1 2.
please help.......
Mar 22 '07 #1
3 2929
arne
315 Expert 100+
In my homework i need to write a function that inputs and integer between 1 and 32767 and prints it as a series of digits, each pair of which is separated by two spaces. for example 3412 should print as : 3 4 1 2.
please help.......
What have you done so far? Are you stuck with any specific problem?
Mar 22 '07 #2
how can i use function 1 and 2 to write a function that inputs an integer between 1 and 32453, and prints it as a series of digits, each pair by two spaces. ex.3245 print: 3 2 4 5;
Mar 22 '07 #3
sicarie
4,677 Expert Mod 4TB
how can i use function 1 and 2 to write a function that inputs an integer between 1 and 32453, and prints it as a series of digits, each pair by two spaces. ex.3245 print: 3 2 4 5;
Janice3 -

Please do not double-post. You have attempted to answer arne's question in a different thread - this should have been posted in the other thread (which I will merge after completing this post).

Also, our Posting Guidelines request you not post your full code, perhaps you could give an algorithm for what your code attempted?

Thanks!
Mar 22 '07 #4

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

Similar topics

3
by: Rim | last post by:
Hi, >>> print '%x' % 54 36 >>> print '%b' % 54 Traceback (most recent call last): File "<stdin>", line 1, in ? ValueError: unsupported format character 'b' (0x62) at index 1 >>>
12
by: neutrino | last post by:
Greetings to the Python gurus, I have a binary file and wish to see the "raw" content of it. So I open it in binary mode, and read one byte at a time to a variable, which will be of the string...
14
by: Marcin Ciura | last post by:
Here is a pre-PEP about print that I wrote recently. Please let me know what is the community's opinion on it. Cheers, Marcin PEP: XXX Title: Print Without Intervening Space Version:...
13
by: Kosio | last post by:
Hello, I know of a way to extract digits from a number using the %10 and divide by 10. But I am wondering if there is an algorithm out there that does not use a divide by 10 feature. The...
109
by: jmcgill | last post by:
Hello. Is there a method for computing the number of digits, in a given numeric base, of N factorial, without actually computing the factorial? For example, 8! has 5 digits in base 10; 10! has...
2
by: Ulrich Dorda | last post by:
I need a pytho nscript to read numbers(with loads of digits) from a file, do some basic math on it and write the result out to another file. My problem: I don't get python to use more digits: ...
13
by: ramif | last post by:
Is there a way to print extended ASCII in C?? I tried to code something, but it only displays strange symbols. here is my code: main() { char chr = 177; //stores the extended ASCII...
12
by: waterdriven | last post by:
Hello; I am a newbie. A homework assignment was assigned and I am having trouble getting started. The assignment reads: Write a program to print out the binary value of a 16 bit number.
5
by: dmitrey | last post by:
hi all, could you inform how to print binary number? I.e. something like print '%b' % my_number it would be nice would it print exactly 8 binary digits (0-1, with possible start from 0) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.