Answer:
def getChar():
while True:
in1 = input('Enter first char: ')
try:
if len(in1) != 1:
raise
else:
in2 = input('Enter second char: ')
if len(in2) != 1:
raise
else:
break
except:
print('Enter just one character')
return in1, in2
def chars2string(in1,in2):
print(in1*5 + in2*5)
def main():
ls = getChar()
in1 = ls[0]
in2 = ls[1]
chars2string(in1, in2)
if __name__ == '__main__':
main()
Explanation:
The programming language used is python 3.
The script first defines a function getChar and makes use of a while loop in combination with try and except blocks and IF statements, the code ensures that both inputs that are entered by the user after the prompt are 1 in length. i.e. Just one character. This function returns the two characters that were entered.
The second function that is defined is chars2string this function takes two arguments, It repeats each argument five times and returns a joined string.
Finally, the main function is defined and it calls the getChar function first, the values that are returned by this function is assigned to two variables, that is then passed on to the chars2string function. The main function is called and the Joined string is printed to the screen.
Answer
System restore
Explanation
System restore is a recovery feature that helps restore your system to the previous condition or point. Most computers have system restore disks which are an advantage to the users especially when the computer clashes.These disks are very effective when it comes to restoring the system to its initial state.
Answer: Add more cells in series.
Explanation:
Adding more cells in series will add voltage which will increase the power.
Answer:
#include<stdio.h>
int GetLargest()
{
int a[100],n,largest;
printf("Enter number of elements\n");
scanf("%d",&n);
printf("Enter elements\n");
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
i=0;
largest=a[i];
while(i<n)
{
i++
if(a[i]>largest)
largets=a[i];
}
return largest;
}
void main(){
int largest;
largest=GetLargest();
printf("Largest Number is %d",largest);
}
Explanation:
Here we define one function "GetLargest". This function reads n number of elements and finds the largest number among the n elements. Here we took one array and assumed first element is the largest element. if any element of the array is greater that that element we make that as larger and continues.at the end we are getting largest element in the n numbers and returning that to the main.
Answer:
stopping people from being bullies online.
Explanation: