Computer Science, asked by zaifali914, 5 months ago

Write a program to take character from user, now print its integer value and display its binary equivalent also. (You can specify your logic for only those characters which have 3 digits ascii number)

Answers

Answered by RuwaisnZaid
0

Explanation:

THIS IS YOUR ANSWER:

IN PYTHON CODE:

s = input("enter chracter")

p = len(s)

sum = 0

k = list(s)

for i in k:

j = ord(i)

sum+=j

print("ASCII",sum)

for i in range(2,sum+1):

if sum%i==0 or sum%i==1:

k = i%2

s = str(k)

print(s[::-1],end=" ")

print("= input value Binary format")

MARK ME AS BRAINLY:

FOLLOW ME

Similar questions