School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,443 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,535 people online right now. Registration is fast and FREE... Join Now!




Concatenating a String and int in Python

 

Concatenating a String and int in Python, Python

Dogstopper

29 Jun, 2009 - 04:53 PM
Post #1

D.I.C Regular
Group Icon

Joined: 15 Jul, 2008
Posts: 341



Thanked: 12 times
Dream Kudos: 450
My Contributions
Hello. I have been programming for a while and I have a very humiliating problem.
Heres the code followed by the traceback:

CODE

items = ["pot plant", "painting", "vase", "lampshade", "shoe", "door"]
print('There are' + len(items)numItems + 'items:')


CODE

Traceback (most recent call last):
  File "foobar", line 39, in <module>
    print('There are' + len(items)numItems + 'items:')
TypeError: Can't convert 'int' object to str implicitly


If you can offer assistance, please do.

This post has been edited by Dogstopper: 29 Jun, 2009 - 04:59 PM

User is offlineProfile CardPM
+Quote Post


Dogstopper

RE: Concatenating A String And Int In Python

29 Jun, 2009 - 07:12 PM
Post #2

D.I.C Regular
Group Icon

Joined: 15 Jul, 2008
Posts: 341



Thanked: 12 times
Dream Kudos: 450
My Contributions
NVM I figured it out
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 01:31AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month