Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to keep looping until the user input is valid ?
Post: RE: How to keep looping until the user input is va...

def get_valid_input(value): while True: try: return float( input( value ) ) except ValueError: print( 'LOL, your input is not valid, please try again!!' ) ....
KyawMyo General Coding Help 12 6,222 Jun-10-2019, 02:51 AM
    Thread: How to keep looping until the user input is valid ?
Post: RE: How to keep looping until the user input is va...

Thanks! Finally my program works. really happy learning. looking forward to another program.....will ask question again if get unsolved error myself...
KyawMyo General Coding Help 12 6,222 Jun-09-2019, 12:09 AM
    Thread: How to keep looping until the user input is valid ?
Post: RE: How to keep looping until the user input is va...

Thank!, now the program works after assigned as you mentioned. But I don't want to see unacceptable value for cable size after I input wrongly. Please enter an Ampere:2500 Please enter the cable size...
KyawMyo General Coding Help 12 6,222 Jun-08-2019, 03:24 PM
    Thread: How to keep looping until the user input is valid ?
Post: RE: How to keep looping until the user input is va...

def get_valid_input(value): while True: try: return float(input(value)) except ValueError: print('Oops, that was not a valid number. Try again...') def get...
KyawMyo General Coding Help 12 6,222 Jun-08-2019, 01:02 PM
    Thread: How to keep looping until the user input is valid ?
Post: RE: Please advise, want to keep looping util the u...

def get_valid_input(value): while True: try: return float(input(value)) except ValueError: print('Oops, that was not a valid number. Try again...') def get...
KyawMyo General Coding Help 12 6,222 Jun-08-2019, 09:43 AM
    Thread: How to keep looping until the user input is valid ?
Post: RE: Please advise, want to keep looping util the u...

Thanks, will try!
KyawMyo General Coding Help 12 6,222 Jun-08-2019, 08:49 AM
    Thread: How to keep looping until the user input is valid ?
Post: How to keep looping until the user input is valid ...

def get_valid_input(value): while True: try: return float(input(value)) except ValueError: print('Oops, that was not a valid number. Try again...') def cal...
KyawMyo General Coding Help 12 6,222 Jun-08-2019, 08:02 AM
    Thread: exception handling
Post: RE: exception handling

while True: def input_power(value): while True: try: return float(input(value)) except ValueError: print('Oops, that was not a valid...
KyawMyo General Coding Help 3 2,859 May-07-2019, 01:40 AM
    Thread: exception handling
Post: exception handling

try: power = float(input ("Please entre Power in kW: ")) voltage = float (input ("Please entre Voltage: ")) phase = int(input("1 or 3 phase? ")) except: print("Oops! That was no vali...
KyawMyo General Coding Help 3 2,859 May-06-2019, 07:55 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020