- Original Message -
> From: Steven D'Aprano
> To: tutor@python.org
> Cc:
> Sent: Saturday, April 19, 2014 3:58 AM
> Subject: Re: [Tutor] Creating an Invalid Message for user
>
> Hello Saba, and welcome,
>
> Saba, unfortunately your email is almo
Hello Saba, and welcome,
Saba, unfortunately your email is almost unreadable to me. To me, your
code looks like this:
On Fri, Apr 18, 2014 at 10:19:52PM +0100, Saba Usmani wrote:
> print "Welcome to the binary and decimal converter"loop = Truewhile
> loop: bord = raw_input("Enter b for binary
On 18/04/14 22:19, Saba Usmani wrote:
I am meant to design code for a program that converts from binary number
to decimal and vice versa.
First, you know that python includes functions for doing that already
right? So you are just doing this as a learning exercise?
while loop:
bord = r
Hi,
I am meant to design code for a program that converts from binary number to
decimal and vice versa.
This is what i have so far:
print "Welcome to the binary and decimal converter"loop = Truewhile loop:
bord = raw_input("Enter b for binary or d decimal or exit to exit")if bord
== "b":
Saba Usmani Wrote in message:
>
>
You posted in html so I can't quote your code, but why aren't you
using int() to convert in one call? Second argument is the base
to be used.
value = int ("10011", 2)
othervalue = int ("234") # default to decimal
--
DaveA
_
On 11/04/2014 21:58, Saba Usmani wrote:
Hi,
I am meant to design code for a program that converts from binary number
to decimal and vice versa.
This is what i have so far:
print "Welcome to the binary and decimal converter"
loop = True
while loop:
bord = raw_input("Enter b for binary or d
Hi,
I am meant to design code for a program that converts from binary number to
decimal and vice versa.
This is what i have so far:
print "Welcome to the binary and decimal converter"loop = Truewhile loop:
bord = raw_input("Enter b for binary or d decimal or exit to exit")if bord
== "b":