Answer:
s = input("Input a float: ")
print("{:12.2f}".format(float(s)))
Explanation:
- Read a number from user using the input function of Python.
- Use the format function of Python to correctly format the output according to the given requirements.
- Note: Use Python 3.6 or above for this code to run without any issue.
Output:
Input a float: 1234.56789
1234.57
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:
Theoretically Yes
Explanation:
The data given is linearly separable. So, the subset of the data will also be linearly separable. And it will pass for all training dataset. However, you should definitely never expect such thing In any real-life problem because the data is noisy, for a bazilion of reasons, so no model is guaranteed to perform perfectly.
Answer:
C language does not support strings as a data type. A string is actually one-dimensional array of characters in C language. These are often used to create meaningful and readable programs.
Explanation:
True it usually shows up with a blue underline