---
# System prepended metadata

title: 'Janet - Question: Growing Younger'
tags: [CS, Programming, CWL, Python]

---

# Janet - Question: Growing Younger
###### tags: `Programming` `CS` `Python` `CWL`

## Question

- [Growing Younger](https://pctc.cuttle.org/index.php?action=user_question&grq_id=401)

## Key idea
- ASCII
- python: chr() and ord() conversion
> A-Z : num 65 to num 90
> a-z : num 97 to num 122

## Code

```python=
character = input()
num = ord(character)

if num < 90:
	if num == 65:
		print("z")
	else:
		print(chr(num-1))
else:
	if num == 97:
		print("a")
	else:
		print(chr(num-1))

```
## Reference

- [How to convert an int to ASCII and back in Python](https://www.kite.com/python/answers/how-to-convert-an-int-to-ascii-and-back-in-python)
- [Wikipedia: ASCII](https://en.wikipedia.org/wiki/ASCII)
- [ASCII Python Chart](/QKBzSKxRRpOlp-NyLS2Y4g)