def pig_latin(word):
if word[0].lower() in 'aeiou':
word = word + 'way'
else:
t=''
for x in range(len(word)):
if word[x].lower() in 'aeiou':
break
if word[x].lower() == 'y' and x>0:
break
else:
t+=word[x].lower()
if word[0].isupper():
word = word[len(t):]+word[:len(t)].lower()+'ay'
word = word.title()
else:
word = word[len(t):]+word[:len(t)].lower()+'ay'
return word
word = 'test'
pl = pig_latin(word)
print(pl)
I wrote my code in python 3.8. I hope this helps.
The PHP code is given below:
<h3>PHP code</h3>
if(isset($_REQUEST['login_btn'])){
$email = filter_var(strtolower($_REQUEST['email']),FILTER_SANITIZE_EMAIL); //strtolower changes email to all lower case
$password = strip_tags($_REQUEST['password']);
The remaining code is in the file attached.
Read more about PHP here:
brainly.com/question/27750672
#SPJ1
The two access modes that are used when opening a file for input and output when pickling are rb and wb.
<h3>What is pickling?</h3>
Pickle is generally used in Python to serialize and deserialize a Python object structure. In other words, it is the act of transforming a Python object into a byte stream in order to save it to a file/database, maintain program state across sessions, or transport data over a network. By unpickling the pickled byte stream, the original object hierarchy can be recreated. This entire procedure is comparable to object serialization in Java or .Net.
When a byte stream is unpickled, the pickle module first makes an instance of the original object before populating it with the right data. To accomplish this, the byte stream only carries data relevant to the original object instance.
To learn more about python visit:
brainly.com/question/13437928
#SPJ4
Answer:
Explanation:
The following code is written in Java, the function takes in a list with the previous day's values. The function then uses that list, loops through it and multiplies each individual value by 2 and returns the modified list. The first red square represents the test case for the function, while the second red square in the image represents the output.
public static ArrayList<Integer> doubleIt(ArrayList<Integer> mylist) {
for (int x = 0; x<mylist.size(); x++) {
mylist.set(x, mylist.get(x)*2);
}
return mylist;
}