logo-MindMajix
PostPythonPython
L
Lakshmi sowjanya

Posted on 23rd June 2024|1192 views

0
votes

Typeerror: An Integer Is Required

how to solve typeerror an integer is required in python?

1 answers
Answers
P
naseer mohammad

Posted on 23rd June 2024| views

This error occurs when you want to print the ASCII value of the integer but forgot to typecast the integer type, for example, consider the following program 

q=list(str(45678))

for j in q:

    print(chr(j))  

Here we have to cast the char() function the solution is the following code.

q=list(str(45678))

for j in q:

    print(chr(int(j)))

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number