Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65593 > unrolled thread

Re: Python 2.7.6 help with white spaces?

Started byScott W Dunning <swdunning@cox.net>
First post2014-02-06 22:01 -0700
Last post2014-02-06 22:01 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python 2.7.6 help with white spaces? Scott W Dunning <swdunning@cox.net> - 2014-02-06 22:01 -0700

#65593 — Re: Python 2.7.6 help with white spaces?

FromScott W Dunning <swdunning@cox.net>
Date2014-02-06 22:01 -0700
SubjectRe: Python 2.7.6 help with white spaces?
Message-ID<mailman.6481.1391749294.18130.python-list@python.org>
Oops, thought you said turning a str into an int.  Yeah, I’m actually using Idle on a mac.  I keep trying differnt things but, I’m just very new to this.  

Is this what you’re talking about?

minutes=3
seconds=11

print str(minutes) + ‘:’ + str(seconds)

Unfortunately I keep getting an error.  Also, not really clear on the reasoning behind changing the int to a string?  




On Feb 6, 2014, at 9:45 PM, Chris Angelico <rosuav@gmail.com> wrote:

> On Fri, Feb 7, 2014 at 3:09 PM, Scott W Dunning <swdunning@cox.net> wrote:
>> Is this what you’re talking about?
>> 
>> minutes = “3”
>> seconds = “11”
>> 
>> print int(minutes), ”:" int(seconds)
>> 
>> That’s what you mean by turning a string into an int right?  Not sure how to add strings together though.
>> 
> 
> Well, that's what I would have meant, if I'd talked about turning a
> string into an int :) Now, can you do the opposite? Turn an int into a
> string? It's done in very much the same way.
> 
> Adding strings together is done in the same way as adding integers,
> lists, or anything else:
> 
>>>> 'foo' + 'bar'
> 'foobar'
> 
> And remember this, whatever else you do: The interactive interpreter
> is your friend. Keep it handy. On Windows, you'll find IDLE in your
> Start menu - it's awesome for this sort of thing. On Linux, you might
> need to explicitly install IDLE. Either way, you can also just type
> "python" at the command line, and you'll get something that lets you
> type stuff in and see the result, like I showed above; it's called a
> Read-Evaluate-Print Loop, or REPL.
> 
> ChrisA
> -- 
> https://mail.python.org/mailman/listinfo/python-list

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web