Enter a number and recognize it as a character

Asked 2 years ago, Updated 2 years ago, 21 views

a=chr(input("first digit: "))

After receiving a number like this, I want to convert it to chr type, but I keep getting errors What is the problem?

python

2022-09-22 15:59

1 Answers

Returns a string is input chr is integer I input error because as the brother.

You can change it back to integrer and use it.

a=chr(int(input("first digit: ")))))


2022-09-22 15:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.