Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.  Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print `Yes`; if it cannot, print `No`.

Submission attempts (in order):
import sys
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
if not a == 0:
 a = input()
 a = int(a)
 k = range(1,a)
 for s in k:
  res = a/s
  #print("s",s)
  #print("res",res)
  try:
   res = int(res)
  except:
   break
  if is_integer(s):
   if is_integer(res):
    if len(str(s)) == 1:
     if len(str(res)) == 1:
      #print(res,s)
      if res * s == a:
       print("Yes")
       sys.exit()
print("No")

import sys
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
a = input()
a = int(a)
if  a == 1:
 print("Yes")
 sys.exit()
k = range(1,a)
  for s in k:
   res = a/s
   #print("s",s)
   #print("res",res)
   try:
    res = int(res)
   except:
    break
   if is_integer(s):
    if is_integer(res):
     if len(str(s)) == 1:
      if len(str(res)) == 1:
       #print(res,s)
       if res * s == a:
        print("Yes")
        sys.exit() 
print("No")


import sys
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
a = input()
a = int(a)
if  a == 1:
 print("Yes")
 sys.exit()
 else:
  k = range(1,a)
  for s in k:
   res = a/s
   #print("s",s)
   #print("res",res)
   try:
    res = int(res)
   except:
    break
   if is_integer(s):
    if is_integer(res):
     if len(str(s)) == 1:
      if len(str(res)) == 1:
       #print(res,s)
       if res * s == a:
        print("Yes")
        sys.exit() 
print("No")

import sys
a = map(int, input().split())
k = range(1,a)
for s in k:
 res = a/k
 if isinstance(res, int):
  if len(k) == 1:
   if len(res) == 1:
    #print(res,k)
    print("Yes")
    sys.exit()
print("No")

import sys
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
a = input()
a = int(a)
if  a == 1:
 print("Yes")
 sys.exit()
 k = range(1,a)
 for s in k:
  res = a/s
  #print("s",s)
  #print("res",res)
  try:
   res = int(res)
  except:
   break
  if is_integer(s):
   if is_integer(res):
    if len(str(s)) == 1:
     if len(str(res)) == 1:
      #print(res,s)
      if res * s == a:
       print("Yes")
       sys.exit()
print("No")


import sys
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
a = input()
a = int(a)
if  a == 1:
 print("Yes")
 sys.exit()
k = range(1,a)
for s in k:
 res = a/s
 #print("s",s)
 #print("res",res)
 try:
  res = int(res)
 except:
  break
 if is_integer(s):
  if is_integer(res):
   if len(str(s)) == 1:
    if len(str(res)) == 1:
     #print(res,s)
     if res * s == a:
      print("Yes")
      sys.exit() 
print("No")


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted