1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SCORPION-xisa [38]
3 years ago
8

In the last problem, we get an error if we enter more than one character at a time. Rewrite the program so that it only calls th

e ord method if a single character is entered.
I have this code so far I just don't know how to make it print not a character
ch= input("Enter a character: ")
print("ASCII #%d" %ord(ch[0]))
Computers and Technology
1 answer:
11111nata11111 [884]3 years ago
4 0

Answer:

ch= str(input("Enter a character: "))

if str.isalpha(ch)==True:

   print("ASCII #%d" %ord(ch))

else:

   print("Not accepted")

Explanation:

Above, we check if the input is an alphabet, and only then ord is called or else Not accepted message is printed.

You might be interested in
While using a Web-based order form, an attacker enters an unusually large value in the Quantity field. The value she entered is
maxonik [38]

Answer: integer overflow

Explanation:

The type of attack has occurred in this scenario is a integer overflow. An integer overflow occurs when there's an attempt by an arithmetic operation to create a numeric value which is outside the range which the given numbers are able to represent.

In this, the integer overflow occurs when the result of the integer operation cannot be able to fit in the allocated memory space which then brings about an unexpected result.

6 0
3 years ago
An array name is a pointer constant because the address stored in it cannot be changed during runtime.
choli [55]
The answer to your question would be option B- False
5 0
3 years ago
Read 2 more answers
A security analyst accesses corporate web pages and inputs random data in the forms. The response received includes the type of
leonid [27]

Answer:

Option c is the correct answer for the above question.

Explanation:

  • The vulnerability is a term that is used to state that any system has some limitation by which the system causes an error while performing the action.
  • The above question states a software and asked the action which is used by the analyst to prevent the limitation. So the system will use the input validation.
  • It is because this prevents the error. it is because this will help to proceed with the wrong or invalid information on the database and the database or system can not hold the wrong data.
  • Hence option c is the correct answer while the other option is not correct because other options can not able to fix the limitation of the above system.
6 0
3 years ago
What is objective reporting?
stira [4]
Objective reporting is reporting that separates facts and opinion.
7 0
3 years ago
If you touch a downed powerline covered or bare, what's the likely outcome
ANEK [815]

you would be shocked, it can even kill you

5 0
3 years ago
Other questions:
  • A drivers touches a cars steering wheel on a hot day which term refers to the way heat is transferredd to the drivers hand
    6·2 answers
  • The _________ contains frequently used formatting commands that are displayed when selecting text or objects with the mouse.
    7·1 answer
  • Assume that success is a variable of type boolean that has been declared. Assume that processor refers to an object that provide
    6·1 answer
  • The Circle of Growth
    10·1 answer
  • PREDATION AND EVOLUTION
    12·1 answer
  • Select the two true statements about functions with parameters:
    15·1 answer
  • What is outlook used for?
    14·2 answers
  • Which 1898 film did George Melies create using camera trickery to create a illusion in which we now
    11·1 answer
  • 2.2 Write an interactive C# program that asks the user to input an integer number. The program checks whether the number entered
    10·1 answer
  • You would like to help guide your company in choosing between valuing privacy and increasing the company's bottom line. What is
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!