zaahidali / Crash-Course-on-Python-by-Google

Quiz solution for this course
88 stars 226 forks source link

error #7

Open dhruvabhat24 opened 1 year ago

dhruvabhat24 commented 1 year ago

sir I have written same code but in the input part

Display your wordcloud image

myimage = calculate_frequencies(file_contents) plt.imshow(myimage, interpolation = 'nearest') plt.axis('off') plt.show() NameError Traceback (most recent call last)

in 1 # Display your wordcloud image 2 ----> 3 myimage = calculate_frequencies(file_contents) 4 plt.imshow(myimage, interpolation = 'nearest') 5 plt.axis('off') NameError: name 'file_contents' is not defined Now what should I do
RanaNomanAbbas commented 1 year ago

Hmmmm, according to this Sections of Code you don't have any variable named "file_contents". But you are using it as a File path. To rectify the problem, you should declare a variable named "file_contents" and initialize it the path of File.

On Mon, 6 Feb 2023, 7:25 am Dhruva Bhat, @.***> wrote:

sir I have written same code but in the input part

Display your wordcloud image

myimage = calculate_frequencies(file_contents) plt.imshow(myimage, interpolation = 'nearest') plt.axis('off') plt.show() NameError Traceback (most recent call last) in 1 # Display your wordcloud image 2 ----> 3 myimage = calculate_frequencies(file_contents) 4 plt.imshow(myimage, interpolation = 'nearest') 5 plt.axis('off')

NameError: name 'file_contents' is not defined

Now what should I do

— Reply to this email directly, view it on GitHub https://github.com/zaahidali/Crash-Course-on-Python-by-Google/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQIGZ3CQU3X4V3T4KPEZFX3WWBOIZANCNFSM6AAAAAAUSEJFFY . You are receiving this because you are subscribed to this thread.Message ID: @.***>