body: From the footer on all SE sites, user contributions are licensed as CC BY-SA 3.0:
  
  
  
  > 
  > site design / logo © 2018 Stack Exchange Inc; user contributions licensed under [cc by-sa 3.0](https://creativecommons.org/licenses/by-sa/3.0/) with [attribution required](https://stackoverflow.blog/2009/06/25/attribution-required/).
  > 
  > 
  > 
  
  
  Whilst licensing it as CC BY-SA 3.0 I sometimes want to license my code as MIT, GPL or any other license. This would allow users to take the code from one of my posts under a license which isn't CC BY-SA and have more freedom with the code.
  
  
  And so my question is how could you dual license code in a code block?
  
  
  
  
  ---
  
  
  I think something like the following would work, but I'm not sure if it's ok:
  
  
  
  > 
  > The following codeblock is licensed under [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) and [GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
  > 
  > 
  > 
  > ```
  > print("Hello World")
  > 
  > ```
  > 
  > 
  
  
  
title: How to dual licencing code on SE