Answer:
def replace_at_index(str, number):
new = str.replace(str[number], "-")
return new
print(replace_at_index("eggplant", 3))
Explanation:
- Create a function called <em>replace_at_index</em> that takes a string and an integer
- Initialize a new variable called <em>new</em>, that will hold the new string
- Replace the character at given index with dash using <em>replace</em> function, it takes two parameters: the first is the character we want to replace, the second is the new character.
- Return the new string
- Call the function with the required inputs
Answer:
for ( initialization; condition;increment)
{
code goes here;
}
in python:
for i in list/range:
code with proper indentation
By initialization above we mean, like int i=0; etc.
By condition like i<10;
and by increment it means like i++, ++i or i+=1; etc
And in python, i can be an integer value if the range is mentioned, and it can be an item of a list if the list is used. We can also use an array, string and various other data structures in python. like we can have characters in a string and so on.
Explanation:
Please check the answer section.
Answer:
Code is provided in the attachment form
Explanation:
Vector Multiplication code:
Vector_multiplication.c file contains C code.
See attachment no 1 attached below
Classification of Algorithm: For creating elements in vector c of size n, number of scalar multiplications is equal to n. The size of original two vectors scales directly with the number of operations. Hence, it is classified as O(n).
Answer:
<dd> tag is used
Explanation:
The <dd> tag is used in HTML document to explain set of terms. The <dd> tag list is used in conjunction with the <dl> term. Inside a <dd> tag we can insert text, sentence, paragraph or links. There are 4 primary tags to build any website. Every HTML document begins and ends with HTML tag.
That would be an Ergonomic keyboard, due to the fact that it is laid out in such a way that doesn't harm your wrists