How does python's sympy tell if it's plural?

import sympy
x=sympy.symbols("x")
s="x**6 + x**5 + x**4 + x**3 + x**2 + x + 1".replace(" ","")
r=sympy.solve(s,x)
print(r)
for i in r:
    print(i)

the result is
-cos (pi/7)-I sin (pi/7),-cos (pi/7) + I sin (pi/7), cos (2 pi/7)-I sin (2 pi/7), cos (2 pi/7) + I sin (2 pi/7),-cos (3 pi/7)-I sin (3 pi/7) -cos (3 pi/7) + I sin (3 pi/7)]
-cos (pi/7)-I*sin (pi/7)
-cos (pi/7) + I*sin (pi/7)
cos (2 pi/7)-I sin (2*pi/7)
cos (2 pi/7) + I sin (2*pi/7)
cos (3 pi/7)-I sin (sin) < sin >-sin (3 < sin > em) + I sin (2*pi/7)
cos (3 pi/7)-I sin (2*pi/7)
cos (3 pi/7)-I sin (em) < sin >-sin (3 pi/7) + I sin (2*pi/7)
cos (3 pi/7)-I sin (2*pi/7)
cos (3 pi/7)-I sin (2*pi/7)
cos (3 pi/7)-I em (em / em > sin (3*pi/7)
how can I tell if-cos (3 pi/7) + I sin (3*pi/7) is a plural?

May.26,2022

  • use isinstance directly
x = 2j+1
if isinstance(x, complex):
    print('X is complex')
  • if it is numpy

there is a method numpy.iscomplex (x) directly

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e41f86-438f1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e41f86-438f1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?