Ahmet Can KEPENEK wrote:
> Hello,
> I used regular expression module of python. I checked binary and denary
> numbers. If input is invalid i
> ask again. I edited your code. Code is below follow as .
>
[snip]
> if re.match("^[0-1]*$", binary):
> if re.match("^[0-9]*$", denary2):
[
Hello,
I used regular expression module of python. I checked binary and denary
numbers. If input is invalid i ask again. I edited your code. Code is below
follow as .
import re
def show_menu():
print("===")
print("1-binary to denary")
print("2-denary to binary")
print("3-e
On 10 February 2013 15:29, Ghadir Ghasemi wrote:
> Hi guys, I wondered if you knew what I could add to this code so that when
> the user enters 1 from the menu and then doesn't enter a valid binary number
> the program should ask them over and over again until valid binary number is
> entered.
Hi guys, I wondered if you knew what I could add to this code so that when the
user enters 1 from the menu and then doesn't enter a valid binary number the
program should ask them over and over again until valid binary number is
entered.
here is the code:
def show_menu():
print("==