The average tourist will have a brush with the law only if they are a victim of petty theft. If you're stopped by the police in both Italy and Switzerland, you will be required to show your passport.
Possession of any controlled substances, including cannabis or marijuana, is illegal. Those caught in possession of 5g of cannabis can be considered traffickers and prosecuted as such. The same applies to tiny amounts of other drugs. Those caught with amounts below this threshold can be subject to minor penalties. You should be equally circumspect in Switzerland.
If driving, the legal limit in both countries for blood-alcohol level is 0.05% and random breath tests do occur.