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
Assume that the string oldSeq has been properly declared and initialized and contains the string segment. Write a code segment t
son4ous [18]

String oldSeq="1100000111";

String segment="11";

String newSeq=oldSeq.replaceFirst(segment, "");

7 0
3 years ago
Question 4 Multiple Choice Worth 5 points)
Morgarella [4.7K]

The correct answer is Boolean logic.

Booleans are true or false statements.

An example of a while loop is:

while 1 < 5:

   #do something.

The Boolean statement is 1 < 5 which evaluates to true because 1 is less than 5.

I hope this helps!

3 0
3 years ago
Open punctuation means that no punctuation follows the salutation or complimentary close. *
zloy xaker [14]

Answer:

True

Explanation:

When open punctuation is used, we do not expect the use of punctuation after salutation or complimentary close. It is a relatively new concept in business writing and we can rightly use this method in modified block letter style of writing.  

Some companies have developed business letter templates that are arranged in an open style, which permits the use of open punctuation in all aspect of business writings.  

7 0
3 years ago
An Administrator wants to have a thank you email sent after the form on the "Request a Demo" landing page is submitted. Where ca
sweet [91]

Answer:

Answer D is correct :

Explanation:

Configure an autoresponder email to send as a completion action when the \Request a Demo\ form has been submitted.

6 0
3 years ago
I need some helpppppppppopoppppppppp
Yuri [45]

Answer:

Adding images: picture drawing box and insert tab

Formatting images: crop and picture styles

Explanation:

picture drawing box and insert tab would be options to add images

formatting (or editing) the images would be crop, and picture styles

4 0
3 years ago
Read 2 more answers
Other questions:
  • Keep getting the message i failed to sign in to email on my phone but i can open my email. whats going on?
    10·2 answers
  • How many bytes of information can be stored on a hard drive?
    7·1 answer
  • Create an application containing an array that stores eight integers. The application should call five methods that in turn (1)
    7·1 answer
  • Identify an advantage of working in teams.
    8·1 answer
  • Write a program that prompts the user to enter three cities and displays them in ascending order. Here is a sample run: Enter th
    8·1 answer
  • Which category does this fall in identity theft​
    6·1 answer
  • What is the importance of charts and graphics in providing<br> information?
    15·1 answer
  • 100 points, PLEASE HELP...To generate numbers between and including -10 to 10 you would use:
    5·1 answer
  • Read the following code:
    6·1 answer
  • Declaring a member as ____ in the base class provides access to that member in the derived classes but not to anyone else. a. pu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!