answersLogoWhite

0

Well, say you have a foo function you want to call with input (from raw_input) but ONLY if it is an int.

number = raw_input("Enter an integer: ")

try:

number = int(number)

foo(number)

except ValueError:

print "Number wasn't an integer!"

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Is a California trap door spider stronger than a python?

A spider, even a large spider, is much, much smaller than a python, even a small python. Proportionally to their size, the spider MIGHT be stronger, but a python could easily squish a spider without any trouble.


How does a fluke trap its prey?

by waitng for a fish to pass above it


How do you pass general white's trap on dragonball orgins 2?

freeze the tail \


What is the process of collecting the ball from a teammate's pass or opponents miscue and taking complete control of the ball in a soccer game?

chest trap, instep trap, thigh trap, just get the ball under control!


What is the name given to the rocks that trap water and do not allow it to pass through?

Impermeable rocks are those that trap water and do not allow it to pass through due to their low permeability. These rocks effectively act as barriers, preventing the movement of water underground.


When boating on the river what is a strainer?

STRAINER- an obstacle in the water (like a fallen tree branch) which allows water to pass through, but can trap and hold boats and passengers


What is a steam trap?

A device that will allow cooler condensate to pass and hold back the higher temperature steam


What is the term for stopping a pass in Soccer?

Lots of terms are used, like a trap, a block an interception and many others.


What does the bicuspid do?

the biscuspid valve works as a trap door opening when the oxygented blood needs to pass to the left ventricle


What qualifications do you need to be a groundsman at a football club?

To make trap and pass and to shot the tagert at stamin on your chest and you must have a muscle


When boating on a river you may encounter strainers what are stairs?

STRAINER- an obstacle in the water (like a fallen tree branch) which allows water to pass through, but can trap and hold boats and passengers


How do you get out the trap in Harry Potter 6?

When Crabbe and Goyle trap you in the Astronomy Tower you must find the lever to the unlocking device, Wingardium Leviosa it, through it against something, then you will will be able to pass it through the gate to the place it needs to be.