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
nevsk [136]
4 years ago
6

Using the slice operator, print your first, then last name.2. Print the length of your first name.3. Assume you have two variabl

es: s='s' and p='p'. Using concatenation and repetition, write an expression that produces the string mississippi.

Computers and Technology
1 answer:
Mnenie [13.5K]4 years ago
6 0

Answer:

Check the explanation

Explanation:

we will be writing the below codes in answering the question above.

The Code:

name="Tony stark"

firstname=name[0:4]

lastname=name[5:]

print(firstname,lastname) #first one

print(len(firstname)) #second one

s='s'

p='p'

i='i'

result='m'+i+(s*2+i)*2+p*2+i #third one

print(result)

The output can be seen in the image below.

You might be interested in
Please help me with these questions
adelina 88 [10]

3. A, (first choice)

4. C (Third choice from top)


6 0
3 years ago
Chegg Suppose the heap is a full tree, size 2^n-1. what is the minimum number of steps to change a min heap to a max heap. Show
adoni [48]

Answer:

Explanation:

We start from the bottom-most and rightmost internal node of min Heap and then heapify all internal modes in the bottom-up way to build the Max heap.

To build a heap, the following algorithm is implemented for any input array.

BUILD-HEAP(A)

   heapsize := size(A)

   for i := floor(heapsize/2) downto 1

       do HEAPIFY(A, i)

   end for

Convert the given array of elements into an almost complete binary tree.

Ensure that the tree is a max heap.

Check that every non-leaf node contains a greater or equal value element than its child nodes.

If there exists any node that does not satisfy the ordering property of max heap, swap the elements.

Start checking from a non-leaf node with the highest index (bottom to top and right to left).

4 0
3 years ago
_________ is the primary measurement used to gauge your typing ability
Reil [10]

Answer:

Words per minute

Explanation:

5 0
3 years ago
During data declaration, a name is binded to a memory location, what else can be identify as part of this process?
igomit [66]

data declaration means a variable which contain data value and it can be declared as integer, float, character, double, boolean (data types).

example:

int r;

char name;

float g;

double k= 23.34;

5 0
3 years ago
Perform algorithm time measurement for all three quadratic sorting algorithms for Best Case (already sorted), Average Case (rand
Kaylis [27]

Answer:

Experiment size : 50,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 0.162

Average case : 0.116

Best case : 0.080

Insertion sort :

---------------------------------------------------------

Worst case : 0.162

Average case : 0.116

Best case : 0.080

Bubble sort:

--------------------------------------------------------

Worst case : 0.211

Average case : 0.154

Best case : 0.117

Experiment size : 100,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 0.316

Average case : 0.317

Best case : 0.316

Insertion sort :

---------------------------------------------------------

Worst case : 0.316

Average case : 0.317

Best case : 0.316

Bubble sort:

--------------------------------------------------------

Worst case : 0.482

Average case: 0.487

Best case : 0.480.

Experiment size : 200,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 1.254

Average case : 1.246

Best case : 1.259

Insertion sort :

---------------------------------------------------------

Worst case : 1.254

Average case : 1.246

Best case : 1.259

Bubble sort:

--------------------------------------------------------

Worst case : 1.990

Average case : 2.009.

Best case : 1.950

Explanation:

[NB: since it is very long there is the need for me to put it it a document form. Kindly check the doc. Files. The file A is the sort Analysis.Java file and the file B is the sort.Java file].

The concept of algorithm time measurement strictly depends on the following;

=> The measurement of time, space or energy on different sizes.

=> Plotting of the measurements and characterizing them.

=> Running or implementation of the algorithm.

Programming language such as Java can be used in accessing the operating system clock and Java had two static methods.

KINDLY CHECK BELOW FOR THE ATTACHMENT.

Download doc
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> doc </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> doc </span>
5 0
3 years ago
Other questions:
  • What was the han dynasty and the roman empire known for?
    5·1 answer
  • How to know if somebody else is listening my conversations by cellphone?
    13·1 answer
  • What is the code for loading image in matlab
    15·1 answer
  • How is actual cost calculated?<br><br> Please answer
    12·1 answer
  • Exampels of semantic tags ?​
    7·1 answer
  • What is a scholary or systemic investigation or injury about a subject?
    14·1 answer
  • You have just purchased a motherboard that has an LGA 1156 socket for an Intel Pentium processor. What type of memory modules wi
    14·1 answer
  • D) Informal high level descuption of an algorithm in english kcalled
    9·2 answers
  • In cell K8, create a formula using the SUM function that calculates the total of range D17:D20 and subtracts it from the value i
    7·1 answer
  • Why isn't image display working on wacom tablet.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!