0
Can we use str.isdigit() and str.isalpha() without importing any library or modules?
input_1 = input() calc = input_1.split() print(calc[0]) calc[0].isdigit() This prints only the value of calc[0]. Not printing True or False. Why is this code not returning whether calc[0] is a digit or not?
1 Resposta
+ 4
It works without importing anything, it needs just a print statement:
calc = input().split()
print(calc[0])
print(calc[0].isdigit())