473,396 Members | 2,154 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.

this worked before...' '.join([`x x` for x in range(1, 6)])

' '.join([`x x` for x in range(1, 6)])

anyone can tell me what im doing wrong?
Jun 27 '08 #1
3 1039
no**********@yahoo.se wrote:
' '.join([`x x` for x in range(1, 6)])

anyone can tell me what im doing wrong?
--
http://mail.python.org/mailman/listinfo/python-list

' '.join(['%s %s' % (str(x), str(x)) for x in range(1,6)])

or

' '.join([str(x)+' '+str(x) for x in range(1,6)])
outputs....

'1 1 2 2 3 3 4 4 5 5'
Is that what you were after ?
Jun 27 '08 #2
John McMonagle <jm********@velseis.com.auwrites:
no**********@yahoo.se wrote:
>' '.join([`x x` for x in range(1, 6)])

anyone can tell me what im doing wrong?
--
http://mail.python.org/mailman/listinfo/python-list


' '.join(['%s %s' % (str(x), str(x)) for x in range(1,6)])

or

' '.join([str(x)+' '+str(x) for x in range(1,6)])
outputs....

'1 1 2 2 3 3 4 4 5 5'
Is that what you were after ?
Or:

' '.join(str(i//2) for i in xrange(2, 13))

?

--
Arnaud
Jun 27 '08 #3
On Mon, 19 May 2008 15:28:48 -0700, notnorwegian wrote:
' '.join([`x x` for x in range(1, 6)])

anyone can tell me what im doing wrong?
I doubt that this worked before because that's a syntax error:

In [84]: ' '.join([`x x` for x in range(1, 6)])
------------------------------------------------------------
File "<ipython console>", line 1
' '.join([`x x` for x in range(1, 6)])
^
<type 'exceptions.SyntaxError'>: invalid syntax

The backticks are syntactic sugar for the `repr()` function and
``repr(x x)`` isn't legal syntax either.

Ciao,
Marc 'BlackJack' Rintsch
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: WØCBF | last post by:
I know this code has worked before but now appears to get a compile error. The code it seems to choke on line 12. I receive the following message and it highlights the "rst!" statement. Error...
2
by: Steve Y. | last post by:
My Environment ..Net SDK 1.1 on remote Win2k Server Connecting with VS 2003 via FrontPage Extension Error "The web server reported the following error when attempting to create o open the Web...
0
by: Edwin Knoppert | last post by:
This grid used a template having a button (Button1). The del button ran a javascript to ask y/n. Then it passed the GridView1_RowCommand() where i was able to determine the record id (eval) The...
1
by: pmkconsulting | last post by:
Hello, I am using an asp script that uses rptserver.asp to display some reports over http. It worked fine previously but now the webpages with the report display just hang. I tried switching from...
1
by: gmurnag | last post by:
Hello I work on a database that needs to work on French and English version of Windows and Office - and work on computers with any combination of Windows 2000, Windows XP, Office 2000, Office XP,...
2
by: comp.lang.php | last post by:
I came up with functions that I thought would do the trick: if (!function_exists('smtp_close')) { /** * This function will close a socket resource handle * * Original function found at...
0
by: Patrick Mullen | last post by:
How about: class A: def add(self,x,y): return x+y class B(A): pass print B().add(1, 2)
10
chelvan
by: chelvan | last post by:
hi its me again is it possible to calling a function in < a > onclick event? thanks in advance chel-1
1
by: jas2803 | last post by:
I have two tables, active clients and shipments. Shipments tables is like this client, date, amount the clients table is: client, state, city I use this to get the Max amount per client for a...
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
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
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.