-3

I'm unable to compare users input as str or int in following code..

A=input(" ") 
if type(A)=str: 
    Print("this is string") 
elif type(A)=int: 
    Print("this is integer")

So please tell me how to deal with this type of problem

tobias_k
  • 81,265
  • 12
  • 120
  • 179

1 Answers1

0

use string class isdigit() method to check user input is number or string.