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
nydimaria [60]
4 years ago
12

7.6 LAB: Checker for integer string Forms often allow a user to enter an integer. Write a program that takes in a string represe

nting an integer as input, and outputs yes if every character is a digit 0-9. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or any string with a non-integer character, the output is: no
Computers and Technology
1 answer:
Evgen [1.6K]4 years ago
7 0

Answer:

Following are the program in the Python Programming Language:

def check(num): #define function

 if(num.isdigit()): #set if statement

   return "yes"; #return yes if condition is true

 else:  

   return "no";# return no if condition is false

string=input("Enter the numbers 0-9: ") #get input from the user

print(check(string)) #print and call the function

Output:

Enter the numbers 0-9: 1995

yes

Enter the numbers 0-9: 42,000

no

Explanation:

Here, we define a function "check()" and pass an argument in its parameter "num" inside the function.

  • we set if-else conditional statement and check the value stored in the variable "num" is the digit by using built in function "isdigit()" then return "yes".
  • Then, otherwise it return "no".

Finally, we get the input from the user in the variable "string" then, we call the function through "print()" function.

You might be interested in
You need to install a 32-bit application on a 32-bit version of windows 10. In which default directory will the application be i
luda_lava [24]

Answer:

%systemdrive%\Program Files

7 0
2 years ago
John wants to draw a letter L. The turtle is pointing towards the top of the screen. Which series of commands will draw the shap
ArbitrLikvidat [17]

Explanation:

BACK 100 RIGHT 90 FORWARD 50

6 0
2 years ago
Examine the following output:
bixtya [17]

The report shows that SERVER1 has six active TCP connections. The first two are in the state TIME WAIT, the third is in the state CLOSE WAIT, and the final three are in the state ESTABLISHED.

TCP: What is it?

One of the key protocols in the Transmission control protocol / internet family is the Transmission Control Protocol. (TCP). It was first used to supplement the Internet Protocol in network protocol deployments (IP). TCP/IP is the name given to the full suite as a result. Software running on hosts communicating via an IP network can transmit a stream of octets (bytes) in a reliable, orderly, and error-checked manner using TCP. TCP is a key component of popular internet services like the World Wide Web mail, remote management, and file transfer.

To know more about TCP
brainly.com/question/28119964
#SPJ4

8 0
2 years ago
Explain the definition of Interllectual Property, Fair Use, Piracy, Plagiarism, and Copyright. And why each of them are importan
alexandr402 [8]
Each are important because if you made the rule on your own subject you would be allowed to not have anyone steal it and if someone did they would haft to pay you. But if you are the one stealing it you get in magor trouble even for filming a clip of something.
3 0
3 years ago
Which protocol is used to encrypt data as it travels a network?
pickupchik [31]
The protocol that's used to encrypt data as it travels a network would be the IPSec.
3 0
3 years ago
Other questions:
  • Which best describes a VPN?
    14·2 answers
  • Which of the following rules should be used to keep the appropriate distance between your vehicle and the vehicle in front of yo
    10·2 answers
  • A technician is trouble-shooting an IDE hard drive that is emitting a humming sound. They suspect a faulty connector. Which of t
    6·1 answer
  • How many errors are in the following formula?
    12·1 answer
  • In which part of a presentation should you provide background information, ask a thoughtful question, or offer an interesting
    8·1 answer
  • Name the type of software which provides the user interface. [1 mark
    5·1 answer
  • Help me guys..<br>thankyou​
    6·1 answer
  • 8.10 Code Practice Question 3
    6·1 answer
  • which option dexcribes a situation when asexual reproduction would be more advantageous to an organism?
    14·1 answer
  • Natural language generation is focused on?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!