Linked Questions

5 votes
6 answers
39k views

I am writing a program that needs to check if a users input is a decimal (the users input must be a deciamal number),I was wondering how I could test a varible to see if it contains only a decimal ...
hpj's user avatar
  • 63
3 votes
1 answer
37k views

I have a Python script which converts a decimal number into a binary one and this obviously uses their input. I would like to have the script validate that the input is a number and not anything else ...
RoyalSwish's user avatar
  • 1,583
2 votes
1 answer
16k views

So I am trying for my program to print the message "That is not an integer!" if the user inputs something that is not an integer basically, I thought this was how you would do that but apparently isn'...
Okym's user avatar
  • 259
-2 votes
4 answers
5k views

Possible Duplicate: Python - How to check if input is a number (given that input always returns strings) I need to check a input and send a error message if it's not numerical. How would i do this ...
Sergei's user avatar
  • 605
1 vote
1 answer
2k views

Starting off by saying I'm completely new to python, I have to do a school project and I'm stuck with this part of the code. Pretty much, the requirements are being met to go through with the IF ...
Sinnx's user avatar
  • 29
0 votes
3 answers
708 views

I have the following piece of code: choice = raw_input("> ") if "0" in choice or "1" in choice: how_much = int(choice) else: dead("Man, learn to type a number.") It seems ...
ntough's user avatar
  • 373
0 votes
1 answer
558 views

I want to make python identify if num1 and num2 were numbers or not in this calculator so that python can notify you're not typing in valid things. Maybe using if statements? num1 = float(input("...
user avatar
1 vote
1 answer
645 views

I want to validate an input to see whether it is a number (integer) or not. This is my code: temp = input("Today's temperature: ") if int(temp): temperature = int(temp) if ...
user1029283's user avatar
-2 votes
2 answers
234 views

q = [] num = ["1","2","3","4","5","6","7","8","9","0"] while True: dat = float(input("Enter ...
Studyante's user avatar
-2 votes
1 answer
420 views

i want to check whether the user input is a number if it is continues the code if its not it re-asks until they enter a number # This progam will simulate a dice with 4, 6 or 12 sides. import ...
Ahmed Abukar's user avatar
2 votes
2 answers
172 views

Have been stuck on this for about an hour. Currently trying to teach myself Programming using Python. I am using a textbook for the programming stuff which walks me through pseudocode and then I ...
Runferurlife's user avatar
1 vote
1 answer
321 views

I am trying to build an ATM code , but I have another piece of code that is again proving troublesome. Here is the error: How Much Funds Do You Wish To Input Into Your Account? : £1565 Not A Vaild ...
user avatar
0 votes
2 answers
223 views

I'm writing a simple program to accept only numbers. but the program is accepting both letters and numbers I'm using python 3.. I used the int data type in addition to input statement. #A program to ...
Simeon Udoh's user avatar
2 votes
2 answers
139 views

I am trying to write a simple program that checks if a user inputs an integer, but there is a problem with my code. I would like to print out the if statement only if input is not an integer. What is ...
pc510895's user avatar
2 votes
2 answers
152 views

I'm starting out with Python after taking a class that taught us pseudocode. How could I make a validation loop to continue the function if a user inputted a decimal rather than a whole number? At its ...
Michael3216's user avatar

15 30 50 per page
1
2 3 4 5 6