+ 1
Python questions beginner
1 . Can I use inside a string method a variable ? Exemple: if I want to check if a word input from user which is a string match with an specific word from an longer text 2.On line with return keyword can I use print too ?
4 Respuestas
+ 4
1. Yup. It sounds like you use some kind of substring method or even the 'in' keyword.
2. Yup, but I'm not sure if that's good practice because it might be what's called a side effect. So may just want to return the string itself and then have the main function do the printing for you.
+ 2
Justice Thank you !
0
No probs! 😁
0
I was too wondering the same thing, can you send me your code in case you have the answer.