How to Python3 | Sololearn: Learn to code for FREE!


How to Python3

How to compare if variable is a string? like: n = input() if n == (string): print("error string") i dont know the comparison of the placeholder (string)

4/2/2020 3:54:39 AM


2 Answers

New Answer


Try: if isinstance(n, str): print("error string")


Qasem Thanks!