Demo entry 6686547

Carica

   

Submitted by anonymous on Dec 24, 2017 at 07:40
Language: Python 3. Code size: 196 Bytes.

while (True):
	val = input("Enter an integer:")
	try:
		val = int(val)
		print("The square of the number you enter is ", val**2)
	except ValueError:
		print(val, 'is not an integer')

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).