W.A.P to enter single character print the previous 2 and the next 2 characters .
Answers
Answered by
0
Source code: [in Python]
Explanation:
Once the character has been entered using the function, we use functions and to print the previous 2 and next 2 characters corresponding to the character entered. This is in relation to the ASCII values. ASCII values are assigned values/code numbers that represent characters such as letters, numbers, special characters, etc. It helps in the electronic interpretation of what is being typed. An example has been demonstrated below.
would return the character under code 99, which is 'c'. would return the code of 'c' which is 99.
Similar questions