# Write a AZERTY to QWERTY converter [duplicate]

Your task is to create a program will transform each letter of a text typed on a AZERTY keyboard to the equivalent on a QWERTY keyboard, using the same keystrokes.

Example: Hello; Zorld1 => Hello, World!

List of character to convert:

• A <=> Q
• Z <=> W
• , => m
• ? => M
• M => :
• 1 => !
• 9 => (
• ; => ,
• § => ?
• 0 => )
• ) => -
• ù => '

QWERTY keyboard:

AZERTY keyboard:

Test cases:

Input: This is q text zritten zith q QWERTY keyboqrd:
Output: This is a text written with a AZERTY keyboard.

Input: Hello zorld in PythonM print9ùHello; Zorld1ù0
Output: Hello world in Python: print('Hello, World!')

Input: Zikipediq is q free online enciclopediq
Output: Wikipedia is a free online enciclopedia

Input: Progrq,,ing puwwles qnd code)golf
Output: Programming puzzles and code-golf

Input: Zhy ,y lqyout hqve szitched to QWERTY §
Output: Why my layout have switched to AZERTY ?


This is code golf, so the answer with the shortest byte count win.

## marked as duplicate by Peter Taylor code-golf StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jun 28 '16 at 20:55

• Could you please explicitly list which character should be replaced by which? – flawr Jun 28 '16 at 19:06
• @flawr Every character, i'll add this – TuxCrafting Jun 28 '16 at 19:07
• He means an explicit list. Like, A => Q, W => Z, etc. – Conor O'Brien Jun 28 '16 at 19:09
• @TùxCräftîñg Can you please add that list? – flawr Jun 28 '16 at 19:34
• @EʀɪᴋᴛʜᴇGᴏʟғᴇʀ it would seem that valid answers to that challenge would work for this one with minor changes then. So I would agree that it is a dupe. HOWEVER, the other challenge has a lot of restrictions that this one does not. One might argue that this challenge is open to entries from more languages which would be in favor of reopening. – Liam Jul 1 '16 at 15:41

# Python 3, 70 132 bytes

My first try in code-golfing, so please be kind :) :

print(input().translate(str.maketrans('azqwAZQW&é"\'(-è_çà)^$Mù,?;:!§1234567890','qwazQWAZ1234567890-[]:\'mM,./?!@#$%^&*()')))


Try it online!

• ; is converted to m, and numbers should also be handled. Oh and put your code in a code element (code), not a blockquote ;) – TuxCrafting Jun 28 '16 at 19:24
• Should be better now :). – DimP Jun 28 '16 at 19:53
• you can prolly save with a lambda instead of print/input. – Maltysen Jun 28 '16 at 19:54
• ValueError: the first two maketrans arguments must have equal length – TuxCrafting Jun 28 '16 at 19:55
• No such error on my local installation. I have just added a 'try it online' link. – DimP Jun 28 '16 at 20:06