answer.
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
Mandarinka [93]
1 year ago
9

In Python, parentheses are used in calculations where the order of operations affects the outcome. (5 points)

Computers and Technology
1 answer:
iren [92.7K]1 year ago
5 0

Answer: true

Explanation:

You might be interested in
#Write a function called fancy_find. fancy_find should have #two parameters: search_within and search_for. # #fancy_find should
Inessa05 [86]

Answer:

Here is the Python program:

def fancy_find(search_within , search_for):  # function definition of fancy_find function that takes two parameters

   index = 0  #to store the index of search_within where the search_for string is found

   if search_for in search_within:  #checks if the string search_for is present in string search_within

       sf = search_for[0]  #points to the first character of the search_for

       for sw in search_within:  #iterates through search_within

           if sw == sf:  #if the first character of search_for is equal to the character at sw index of search_within

               if search_within[index:index+len(search_for)] == search_for:  #checks if the value of search_for is found in search_within

                   print(search_for,"found at index",index,"!")  #if above condition is true prints the message "[search_for] found at index [index]!", with [search_for] and [index] replaced by the value of search_for and the index at which it is found

                   return ""  

           index += 1  #increments value of index at each iteration

   print(search_for,"is not found within", search_within)  #if search_for is not found within search_within, prints message "[search_for] was not found within [search_within]!" with the values of search_for and search_within.

   return ""    

#following two statements are used to test the working of above function

print(fancy_find("ABCDEF", "DEF"))  #calls fancy_find() passing "ABCDEF" as search_within and "DEF" as search_for

print(fancy_find("ABCDEF", "GHI")) #calls fancy_find() passing "ABCDEF" as search_within and "GHI" as search_for

Explanation:

The program is well explained in the comments. I will explain the working of the function with the help of an example:

Suppose

search_within = "ABCDEF"

search_for = "DEF"

We have to find if search_for i.e. DEF is present in search_within i.e. ABCDEF

if search_for in search_within statement checks using in operator that if DEF is included in ABCDEF. Here this condition evaluates to true so the next statement sf = search_for[0]  executes which sets the first element of search_for i.e. D to sf. So sf = 'D'

for sw in search_within this statement has a for loop that iterates through ABCDEF and works as following:

At first iteration:

sw contains the first character of search_within  i.e. A

if sw == sf: condition checks if the first character of the search_for i.e. D is equal to sw i.e. A. Its not true so the program control moves to this statement:

index += 1 This increases the value of index by 1. index was initialized to 0 so now it becomes 1. Hence index=1

At second iteration:

sw contains the second character of search_within  i.e. B

if sw == sf: condition checks if the first character of the search_for i.e. D is equal to sw i.e. B Its not true so the program control moves to this statement:

index += 1 This increases the value of index by 1. index was initialized to 0 so now it becomes  2. Hence index=2

At third iteration:

sw contains the third character of search_within  i.e. C

if sw == sf: condition checks if the first character of the search_for i.e. D is equal to sw i.e. C Its not true so the program control moves to this statement:

index += 1 This increases the value of index by 1. index was initialized to 0 so now it becomes  3. Hence index=3

At fourth iteration:

sw contains the third character of search_within  i.e. D

if sw == sf: condition checks if the first character of the search_for i.e. D is equal to sw i.e. D. Its true so so the program control moves to this statement:

  if search_within[index:index+len(search_for)] == search_for:

current value of index=3

len(search_for) returns the length of DEF i.e. 3

So the if condition checks for the search_for in search_within. The statement becomes:

if search_within[3:3+3] == search_for:

search_within[3:3+3]  means from 3rd index position of search_within to 6-th index position of the search_within. This means from 4th element of search_within i.e. D to the last. Hence search_within[3:3+3] is equal to DEF.

search_for = DEF so

if search_within[3:3+3] == search_for: checks if

search_within[3:3+3] = DEF is equals to search_for = DEF

Yes it is true so

print(search_for,"found at index",index,"!") statement is executef which prints the following message:

DEF found at index 3!

This output is because search_for = "DEF" and index=3

5 0
2 years ago
A chemical found in the synaptic vesicles , which , when released . has an effect on the next cell is called a?
ruslelena [56]
Neurotransmitters is the chemical found in the synaptic vesicles that, when released, has an effect on the next cell.
7 0
2 years ago
When long labels are required, which of these commands can you use to improve readability of a worksheet?
Morgarella [4.7K]
I believe it is wrap text! Hope this helped
6 0
2 years ago
Read 2 more answers
1. Show that the three security services-confidentiality, integrity, and availabilty- are sufficient to deal with the threats of
nika2105 [10]

Answer:

Answer explained below

Explanation:

1. confidentiality prevents disclosure,availability prevents disruption,integrity prevents accepting wrong data. availability and integrity will prevent disruption. the possessed data if wrongly held then its availability is affected. if actual data is impersonated then integrity is affected.

2. computers are invented by humans. they are programmed by humans. humans may tend to make mistakes and may fail to take care of all real-time possibilities. hence may not be perfectly secure

3.a. o-->owner r-->read w-->write x-->execute

                                             alicerc babrc cyndyrc

      alice                           ox  

      bob                                   rr  

      cyndy

3b                                          alicerc babrc cyndyrc

      alice                                  ox              r            r

      bob                                                     ox  

     cyndy                                  r                rw           orwx  

4. Integrity means that information is correct, and that data has not been corrupted in any way. integrity ensures that information has not been compromised, that the information is valid and is a result of authenticated and controlled activities. If we don’t have any way to confirm and ensure that this is true, we can’t guarantee confidentiality.

5.a.discretionary access control

Since users can assign and modify permissions that they possess, access control is discretionary.

5.b.originator access control

This would be originator access control. This is because if I am the author of the memorandum I am

the one who can say my information can be distributed, no one else can.

5.c.mandatory access control

The system controls access and an individual cannot change that. There is a somewhat tricky scenario

though that could possibly make this discretionary; if there is an owner of the 'military facility' and this person also had the ability to promote military personnel to 'general'. In this way the facility owner could grant access to their facility.

6 0
2 years ago
Which of the following attributes of a website indicates a more reliable source for information?
scoundrel [369]
An attribute of a website that will indicate a more reliable source of information is when the site ends in ".edu". It is a top-level domain for education. It would mean that this particular site is linked to universities, colleges or other educational sites thus it gives more information that is real and factual.
3 0
1 year ago
Other questions:
  • Email, instant messaging and most web traffic go across the internet in the clear; that is, anyone who can capture that informat
    15·2 answers
  • Linda is making handouts for her upcoming presentation. She wants the handouts to be comprehensible to people who do not attend
    12·2 answers
  • Two technicians are discussing lung protection in the shop. Technician A says that respiratory-protection devices can prevent yo
    5·2 answers
  • Pls help me. ask yourself what would jesus do...
    14·1 answer
  • Technician A says that the octane rating of gasoline is the measure of its antiknock properties. Technician B says that normal c
    5·1 answer
  • A ____ resembles a circle of computers that communicate with each other.
    14·1 answer
  • For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: I
    8·1 answer
  • Assume that k corresponds to register $s0, n corresponds to register $s2 and the base of the array v is in $s1. What is the MIPS
    10·1 answer
  • Which of the following statements is true regarding ARPANET? Select 3 options. It was a product of Bell Laboratories and was int
    9·1 answer
  • If Maya wants to access a view that would control multiple slides within a presentation, which view should she utilize? Master v
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!