Answer:
Here the code is given as follows,
Explanation:
def isPalindrome(x):
stack = []
#for strings with even length
if len(x)%2==0:
for i in range(0,len(x)):
if i<int(len(x)/2):
stack.append(x[i])
elif stack.pop()!=x[i]:
return False
if len(stack)>0:
return false
return True
#for strings with odd length
else:
for i in range(0,len(x)):
if i==int(len(x)/2):
continue
elif i<int(len(x)/2):
stack.append(x[i])
elif stack.pop()!=x[i]:
return False
if len(stack)>0:
return false
return True
def main():
while True:
string = input("Enter a string or Return to quit: ")
if string == "":
break
elif isPalindrome(string):
print("It's a palindrome")
else:
print("It's not a palindrome")
if __name__ == '__main__':
main()
the id selector uses the id attribute of an html element to select a specific element give Example ?
Answer:
The id selector selects a particular html element
Explanation:
The id selector is uses the id attribute to select a specific html element. For example, if we have a particular header which is an html element and we want to give it a particular background color, we use the id selector and give it an id attribute in the CSS file. An example of an html header with id = 'blue' is shown below. The style sheet is an internal style sheet.
!doctype html
<html>
<head>
<title>Test</title>
<style>
#blue { background-color: blue;
}
</style>
</head>
<body>
<h1 id = 'blue'>Our holiday</h1>
<p>This is the weekend</p>
</body>
</html>
Write a program that removes all non-alpha characters from the given input. Ex: If the input is: -Hello, 1 world$! the output is: Helloworld
Also, this needs to be answered by 11:59 tonight.
Answer:
Explanation:
The following code is written in Python. It is a function that takes in a string as a parameter, loops through the string and checks if each character is an alpha char. If it is, then it adds it to an output variable and when it is done looping it prints the output variable. A test case has been provided and the output can be seen in the attached image below.
def checkLetters(str):
output = ''
for char in str:
if char.isalpha() == True:
output += char
return output
If you fail a course as a MAIN (residency) course, you can repeat that course as either a MAIN (residency) or an online (IG or IIG) course.
A. True
B. False
In confirmatory visualization Group of answer choices Users expect to see a certain pattern in the data Users confirm the quality of data visualization Users don't know what they are looking for Users typically look for anomaly in the data
Answer: Users expect to see a certain pattern in the data
Explanation:
Confirmatory Data Analysis occurs when the evidence is being evaluated through the use of traditional statistical tools like confidence, significance, and inference.
In this case, there's an hypothesis and the aim is to determine if the hypothesis is true. In this case, we want to know if a particular pattern on the data visualization conforms to what we have.
What order? (function templates) Define a generic function called CheckOrder() that checks if four items are in ascending, neither, or descending order. The function should return -1 if the items are in ascending order, 0 if the items are unordered, and 1 if the items are in descending order. The program reads four items from input and outputs if the items are ordered. The items can be different types, including integers, strings, characters, or doubles. Ex. If the input is:
Answer:
Explanation:
The following code was written in Java and creates the generic class to allow you to compare any type of data structure. Three different test cases were used using both integers and strings. The first is an ascending list of integers, the second is a descending list of integers, and the third is an unordered list of strings. The output can be seen in the attached image below.
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Order: " + checkOrder(10, 22, 51, 53));
System.out.println("Order: " + checkOrder(55, 44, 33, 22));
System.out.println("Order: " + checkOrder("John", " Gabriel", "Daniela", "Zendaya"));
}
public static <E extends Comparable<E>> int checkOrder(E var1, E var2, E var3, E var4) {
E prevVar = var1;
if (var2.compareTo(prevVar) > 0) {
prevVar = var2;
} else {
if (var3.compareTo(prevVar) < 0) {
prevVar = var3;
} else {
return 0;
}
if (var4.compareTo(prevVar) < 0) {
return 1;
} else {
return 0;
}
}
if (var3.compareTo(prevVar) > 0) {
prevVar = var3;
}
if (var4.compareTo(prevVar) > 0) {
return -1;
}
return 0;
}
}
fill in the blanks Pasaline could ----- and ------- very easily.
Answer:
Hot you too friend's house and be safe and have a great time to take care of the following is not a characteristic it was a circle whose equation o