Jump to content

I need someone to help me in something simple in python

ManosMax13

I want to paste a song in python and count how many times a word is said from what I know i did this

eminem="pasted the song"

eminem.lower (Because I dont wanna miss the words with caps)
eminem.lower.count("the word")
but it doesnt work if someone knows how to do that pls tell me.
Im using jupyter notebook if that helps!

 

Thanks,Manos!

Link to comment
Share on other sites

Link to post
Share on other sites

this doesn't work?

eminem="pasted song"

x = eminem.lower().count("the word")

print(x)

 

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, ShadySocks said:

this doesn't work?


eminem="pasted song"

x = eminem.lower().count("the word")

print(x)

 

I am not sure as I encountered another problem when i paste the song it only considers the string the first row and not the rest how do i fix that?

Link to comment
Share on other sites

Link to post
Share on other sites

Take a look at the error message. You are trying to call the count function on the lower function instead of calling it on the returned string. I hope this helps

ಠ_ಠ

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, ShadySocks said:

this doesn't work?


eminem="pasted song"

x = eminem.lower().count("the word")

print(x)

 

Also how do you have this cool dark blue background mine is white

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, ManosMax13 said:

I am not sure as I encountered another problem when i paste the song it only considers the string the first row and not the rest how do i fix that?

Code tag <> icon in edit mode.

Multi line string:

str = """Pasted 
text"""

 

 

ಠ_ಠ

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, shadow_ray said:

Code tag <> icon in edit mode.

Multi line string:


str = """Pasted 
text"""

 

 

 

26 minutes ago, ShadySocks said:

this doesn't work?


eminem="pasted song"

x = eminem.lower().count("the word")

print(x)

 

Thanks guys it worked,btw how is yours this good dark blue background?

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, ShadySocks said:

image.thumb.png.80ff05862b5ac86104f7e5f9f2ba985c.png

Thanks is there a way to make this my python background too?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×