﻿while True:
   reply = input('Wpisz tekst:')
   if reply == 'stop': break
   print(reply.upper())



>>> reply = '20'
>>> reply ** 2
...pominięto tekst błędu...
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'



>>> int(reply) ** 2
400



while True:
   reply = input('Wpisz tekst:')
   if reply == 'stop': break
   print(int(reply) ** 2)
print('Koniec')



>>> S = '123'
>>> T = 'xxx'
>>> S.isdigit(), T.isdigit()
(True, False)



while True:
   reply = input('Wpisz tekst:')
   if reply == 'stop':
      break
   elif not reply.isdigit():
      print('Niepoprawnie!' * 5)
   else:
      print(int(reply) ** 2)
print('Koniec')



while True:
   reply = input('Wpisz tekst:')
   if reply == 'stop': break
   try:
      num = int(reply)
   except:
      print('Niepoprawnie!' * 5)
   else:
      print(int(reply) ** 2)
print('Koniec')



while True:
   reply = input('Wpisz tekst:')
   if reply == 'stop':
      break
   elif not reply.isdigit():
      print('Niepoprawnie!' * 5)
   else:
      num = int(reply)
      if num < 20:
         print('mało')
      else:
         print(num ** 2)
print('Koniec')