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

0

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

Rei

2 Answers

New Answer

+3

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

+1

Qasem Thanks!