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
Ymorist [56]
3 years ago
10

Write a function named ​isDivisible​ that takes two parameters

Computers and Technology
1 answer:
nirvana33 [79]3 years ago
3 0

Answer:

def isdivisible():

   maxint=input("Enter the Max Int")

   int1=0

   int2=0

   int1=input("Enter the first Integer")

   int2=input("Enter the second Integer")

   tup1=(int1, int2)

   print(tup1)

   i = 1

   for i in range(1, int(maxint)-1):

       if int(tup1[0])%i==0 & int(tup1[1])%i==0:

           print(i)

       else:

           continue

       

   

isdivisible()    

1.2 Outputs

First test case:

Enter the Max Int6                                                                                                            

Enter the first Integer2                                                                                                      

Enter the second Integer8                                                                                                      

('2', '8')                                                                                                                    

1                                                                                                                              

2      

Second test case: returning empty list

Enter the Max Int2                                                                                                            

Enter the first Integer13                                                                                                      

Enter the second Integer27                                                                                                    

('13', '27')

Test case 3:

Enter the Max Int4                                                                                                            

Enter the first Integer8                                                                                                      

Enter the second Integer10                                                                                                    

('8', '10')                                                                                                                    

1                                                                                                                              

2        

Explanation:

The program is as above, and the three test cases are also mentioned. We have created a tuple out of two input integer, and performed the output as required.

You might be interested in
What methods do phishing and spoofing scammers use?
Misha Larkins [42]

Answer:

please give me brainlist and follow

Explanation:

There are various phishing techniques used by attackers:

Installing a Trojan via a malicious email attachment or ad which will allow the intruder to exploit loopholes and obtain sensitive information. Spoofing the sender address in an email to appear as a reputable source and request sensitive information

4 0
2 years ago
Write a program that asks for the number of calories and fat grams in a food. The program should display the percentage of calor
Zigmanuir [339]

Answer:

 The solution code is written in Python 3:

  1. calories = int(input("Enter number of calories: "))
  2. fats = int(input("Enter number of fat in grams: "))
  3. if(calories > 0 and fats > 0):
  4.    cf = fats * 9
  5.    if(cf < calories):
  6.        percent = cf / calories  
  7.        if(percent < 0.3):
  8.            print("Food is low in fat")
  9.    else:
  10.        print("Error input. Calories from fat cannot more than total calories")
  11. else:
  12.    print("Error input. Calories and fats must be more than 0")

Explanation:

Firstly, use input function to ask user to enter total number of calories and fat in grams (Line 1-2)

Next we do the first input validation to check if the calories and fats are more than 0 (Line 4). If so apply formula to calculate calories from fats. If not, print error input message (Line 5, 13)

Then we proceed to next input validation to check if calories from fact more than total calories. If so, proceed to calculate percentage of calories from fats and if it is lower than 30%, display the appropriate message (Line 6 - 9). If fail the second input validation, the program will display another error input message again (Line 11)

7 0
3 years ago
The iteration variable begins counting with which number?<br> O 0<br> O 1<br> O 10<br> O 0 or 1
bonufazy [111]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The iteration variable begins counting with 0 or 1.

As you know the iteration mostly done in the looping. For example, for loop and foreach loop and while loop, etc.

It depends upon you that from where you can begin the counting. You can begin counting either from zero or from one.

For example: this program counts 0 to 9.

<em>int total=0;</em>

<em>for(int i=0; i>10;i++)</em>

<em>{</em>

<em>total = total+i;</em>

<em>}</em>

Let's suppose, if you want to begin counting from 1, then the loop should look like below:

<em>int total=0;</em>

<em>for(int i=1; i>10;i++)</em>

<em>{</em>

<em>total = total+i;</em>

<em>}</em>

7 0
2 years ago
Which security option should be used to ensure the integrity and validity of an Access database?
Fynjy0 [20]

Answer:

The best security which could be used to ensure integrity and validity of Access database is:  

O. database password

Explanation:

Database password is the only option that best guarantee the integrity of an Access database due to the fact that, it limits the number of people who would be able to have access to it. This password is an administrative right given to those who are meant to access it and it is expected to be renewed every few months (probably every 3 months).

<em>Without the password, no other person can be able to login. Also, no two individual can be able to login in same time using same credential login details assigned (that is, in scenario of using the same Username and password)</em>

3 0
2 years ago
Read 2 more answers
Ellie wants to use Office 2016 for her catering business. For example, she plans to use Word to maintain her collection of recip
Ainat [17]
The answer will be b . Scroll bar
4 0
3 years ago
Other questions:
  • If you think the user might enter 24.9, you should create a float variable. true or false
    9·1 answer
  • I'd like to edit a picture so that I can remove the background behind an object and have it replaced with a transparent backgrou
    13·2 answers
  • What are two examples of management information systems?
    12·1 answer
  • A______ is a graphical representation of numeric data.
    8·1 answer
  • Create an array to hold the rainfall values. Create a 2nd parallel array (as a constant) to hold the abbreviated names of the mo
    9·1 answer
  • Which element can be changed using the Print pane? Check all that apply.
    9·2 answers
  • World pade is world processing software true or false​
    15·1 answer
  • Explain
    6·1 answer
  • Question is on the picture thank you
    10·1 answer
  • Help! What is this graph and what does it represent?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!