According to a hadith
The salah (prayer) of whoever approaches a _______ and asks him about anything will not be accepted for 40 days and nights
Answer
Muhammad sallallahu alaihi wa sallam said “the salah (prayer) of whoever approaches a fortune-teller and asks him about anything will not be accepted for 40 days and nights.
Source
Sahih Muslim Vol 4: Hadith number 5440.