473,397 Members | 2,033 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,397 software developers and data experts.

Specified string creation.

58
If anybody could give me a simple code snippet that generates numbers 1-10000 then appends the word YAY in front of each digit. It would be most appreciated. Thanks.
Jan 25 '08 #1
3 1189
bvdet
2,851 Expert Mod 2GB
If anybody could give me a simple code snippet that generates numbers 1-10000 then appends the word YAY in front of each digit. It would be most appreciated. Thanks.
Expand|Select|Wrap|Line Numbers
  1. >>> print '\n'.join(['yay%d' % i for i in range(1, 10001)])
  2. yay1
  3. yay2
  4. yay3
  5. yay4
  6. yay5
  7. yay6
  8. yay7
  9. yay8
  10. yay9
  11. yay10
  12. yay11
  13. yay12
  14. ..............
Jan 25 '08 #2
shing
58
Ok, that worked perfectly.

Now I want to join this:

Hello user 1, user 2, user 3, user4
Up to 10000 agaiin.
Jan 26 '08 #3
bvdet
2,851 Expert Mod 2GB
Ok, that worked perfectly.

Now I want to join this:

Hello user 1, user 2, user 3, user4
Up to 10000 agaiin.
The code to do what you requested is almost identical to the code I posted. Give it a try.
Jan 27 '08 #4

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

Similar topics

7
by: Garyrek | last post by:
Hi I have a requirement where I need to make a report for each auto dealer how many hits they got on specified date range, so for each car detail page I increment the counter and total it while...
8
by: Bob Smith | last post by:
I am downloading over http port 80 some contents froma site, but the contents is not properly stored after using ostringstream for temporary storage, and later ostringstream::str() for passing it...
2
by: Fabian | last post by:
Hi, I work with asp.net 2.0 and I have a intermittent error, only happens a few times a day. In the page I evaluate a Query String and then I get data form a database. The code snipped: ...
3
by: aljamala | last post by:
Hello, I have the following method to help me in installing some COM components onto the machine...below is a snippet that is causing the problem... Type objType = null; COMAdminCatalog...
8
by: simonZ | last post by:
I have Function with string parameteres: public string newLine(String string1,String string2,String string3){ StringBuilder webLine = new StringBuilder(); webLine.Append("<tD nowrap>" +...
10
by: John Vottero | last post by:
Why does String.Format have overrides of: Format(string, object) Format(string, object, object) Format(string, object, object, object) Format(string, params object) doesn't the last one...
0
by: Janusz Nykiel | last post by:
I've stumbled upon unexpected behavior of the .NET 2.0 System.Xml.XmlWriter class when using it to write data to a binary stream (System.IO.Stream). If the amount of data is less than a certain...
40
by: =?Utf-8?B?Um9iZXJ0IEUuIEZsYWhlcnR5?= | last post by:
What is the C# command to wait for a specified period of time? I am writing a windows service that will process a file once it has beed created or changed. I'm using the fileSystemWatcher to...
13
by: xzzy | last post by:
None of the following properly do the VB.net double quote conversion because all of the following in csharp convert to \" instead of just a double quote: " I have tried: char...
4
by: yogarajan | last post by:
The specified module could not be found. (Exception from HRESULT: 0x8007007E) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack...
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: 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...
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
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
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
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,...
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.