How to pronounce words with "que" and "qui"??
I'm confused about the pronunciation rule for "que" and "qui". How does it work? I speak Spanish and they sound both make a hard "k" sound, but I'm not sure how it works in Portuguese. The words I've seen are "queijo", or "questionar", and the q make a hard "k" sound, but in words like "tranquilo", it makes a kwee sound? Is it always like this?
It is supposed to be a hard "k" in every word, but as any other language, sometimes the rules don't work (For no actual reason). Most of the words are pronounced as a hard "k", so when you are not sure, use it (Or use both , hard "k" and "ku" or "ke", whatever), however , probably if you say it wrong, people will still be able to understand what you are trying to say. As a brazillian, I can say that "Tranquilo" is perfectly understandable, it does not matter how you pronounce it.
There is really no way to know this, only if you're living it or watching portuguese shows and copy it. Before the new Reforms of Portuguese orthography we had "tremas" to help differentiating these sounds, mostly occurring in pairs like "que", "qua", "gui" "gue", etc. But they weren't precise anyway since there were words with the "kwee" sound you described that didn't even had tremas in the first place, so removing them actually made sense.
If you always want to know beforehand then you should get a highly recommended Portuguese dictionary with IPA transcriptions.
Like RaymondTFR said, unfortunately there's no rule for it. It's one of those random things that you can only learn (memorize) by experience.
But I do think that "que" and "qui" at the beginning of words is always pronounced "ke" and "ki", respectively. For example: Quinta, Quinhentos, Quimera, Questão, Queimar, Querido, etc. Just don't quote me on that. I'm not sure that this applies to all words.
Also, I think that in the majority of words it's pronounced "ke/ki" instead of "kwe/kwi".
"'gue/gui' and 'que/qui' are usually pronounced [ge/gi] and [ke/ki] respectively, but, in some words, the 'u' is pronounced, forming the sounds [gwe/gwi] and [kwe/kwi]. Before the 2009 spelling reform, the 'u' was written with a diaeresis (ë) in such cases, but this convention was abolished in the reform, making it necessary to check the dictionary when in doubt"
source: Modern Brazilian Portuguese Grammar, Second Edition by John Whitlam
edit: I would really, very much recommend this book. It will solve all your questions. I picked it up on amazon for not too much.