First post here;
I'm trying to find if an inputted number is a perfect square. This is what i've come up with (im a complete first timer noob)
import math
num = int(input("enter the number:"))
square_root = math.sqrt(num)
perfect_square = list[1, 4, 5, 6, 9, 00]
ldigit = num%10
if ldigit in perfect_square:
print(num, "Is perfect square")
The list are digits that if the integer ends in, it will be a perfect square.
perfect_square = list[1, 4, 5, 6, 9, 00]
TypeError: 'type' object is not subscriptable
Never seen this before (surprise). Apologies if it's a total mess of logic and understanding.