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:
501.
Explanation:
In Transmission Control Protocol (TCP), sending and receiving of data is done as byte. These bytes are eventually grouped into packets referred to as segment.
The sequence number of the segment if all data is sent in only one segment is the same as the first byte of that segment.
In this scenario, a user datagram connection is sending 500 bytes to a client and the first byte is numbered 501. Thus, if all data is sent in only one segment, the sequence number of the segment is 501. The 501 represents the initial segment number (ISN).
However, assuming the same data was sent in five (5) segments. The sequence number would be;
First segment (1st) = 501.
Second segment (2nd) = 1501.
Third segment (3rd) = 2501.
Fourth segment (4th) = 3501.
Fifth segment (5th) = 4501.
Answer:
Explanation:
pros. convenient, easy to use, and educational cons. addictive, mentally draining, and creates a social divide.
Answer:
Ther are 8 best programming language :
• Javascript
• Swift
• Scala
• Go
• Python
• Elm
• Ruby
• C#