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
balu736 [363]
3 years ago
12

Given the function definition

Computers and Technology
1 answer:
kirza4 [7]3 years ago
4 0

output of the following code fragment that invokes Twist is:

1 14 3

Explanation:

In the function Twist(),two parameters are passed. First is passed by value and second is passed by reference. If a variable is passed by value then any change made by the function will not affect the original value of that variable but when a variable is passed by reference then any change made by the function will change the original value of that variable. When Twist() function invokes with a=3 and b=2 then value of c=3+2 i.e c=5, a=3*3 i.e. a=9 (value of "a" was 3 earlier) and and b=c+a i.e b=5+9. Here only "b"is passed by reference for variable "s" then any change in it's value will be reflected in the "s". That will update the value of "s" to 14.

You might be interested in
How do airbags prevent injury?
NARA [144]

honestly i think ur answer would be D because it keeps you from flying out of the window

8 0
3 years ago
11. What are the two DFS models?12.When you move a file from the Spreadsheets folder to the Corp Documents folder on a Windows S
Vesnalui [34]

Answer/Explanation:

11. Standalone and Domain-based models

12. The moved file takes with it the permission it had in the Spreadsheets folder.

Cheers.

7 0
2 years ago
Describe how you would define the relation Brother-in-Law whose tuples have the form (x, y) with x being the brother-in-law of y
damaskus [11]

Answer:

The expression is :

π[cd) + π(g,h) ],[π(e,f)+π(a,b)])

We will use foreign key and primary key

8 0
3 years ago
Assume the variable myWord references a string. Write a statement that uses a slicing
givi [52]

Answer:

"myWord[-5:]"

Explanation:

So whenever you slice a string, the syntax in python is expressed as:

string[a:b:c]

where a=start index (this is included in the sliced string)

b = end index (this is excluded from the sliced string)

c = increment

If any of these are included, they are set to default values, where a=0, b=len(string), and c=1.

The increment isn't necessary here, and it's just so you know the syntax a bit more

Anyways, I'm assuming when the question asks to display "the last 5 characters in the string" it means in order? e.g "abcdefghijk" -> "ghijk" and not "abcdefghijk" -> "kjihg"

The last piece of information to know is what a negative index represents.

For example if I have the piece of code

"

string = "hello world"

print(string[-1])

"

This will output "d", and the negative 1 represents the last letter. If you did -2, it would output the 2nd to last letter and so on.

So to print the last 5 characters, we simply use the -5 as the starting index.  

"

string = "hello world"

print(string[-5:])

"

This will print "world" or in other words, the last 5 letters. The reason for this is because the -5 in the first spot means the starting index is the 5th to last letter, and when you have the : after the -5, this is the way of telling python you're slicing the string, and not indexing 1 character. You don't need to include another value after that, because it will default to the last index of the string, or more specifically the last index + 1, since the last index is still included.

So the last thing to know, is that if the string isn't greater than 5 characters, it just prints the entire string, and no errors are raised. You can test this out your self as well. So whenever you have a string that's less than 5 characters the entire string is outputted.

3 0
1 year ago
What is the default text-wrapping option when inserting images into a Word document?
JulijaS [17]

Answer:

In line with the text

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Clifford created a table using OpenOffice Writer and entered some information into the table. Later, he needed to add more rows
    15·2 answers
  • The _______________ layer of the TCP/IP protocol suite is responsible for making sure that what leaves one end of the network ar
    9·1 answer
  • John would like to move from the suburbs into the city, but the rent in the city is very high. John has found an apartment he re
    13·1 answer
  • EDVAC stands for? on which theory it is made on?
    15·1 answer
  • What is technology?
    11·1 answer
  • The smallest unit of storage is​
    15·1 answer
  • If you copy and paste from someone else's document (such as a website, a friend's paper, an instructor's solutions manual, etc.)
    15·1 answer
  • Write a method that returns a version of the given array where all the 10's have been removed. The remaining elements should shi
    9·1 answer
  • Driswers.
    13·2 answers
  • You are given a graph G = (V, E) with positive edge weights, and a minimum spanning tree T = (V, E’) with respect to these weigh
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!