String Concatenation in Python
String Concatenation
You just need to take two strings as input from stdin and concatenate them and print the concatenated string to the stdout.
Input Format
You will be taking two strings as an input from stdin one on each line respectively.
Constraints
1 <= |S| <= 10000
Output Format
You need to print the concatenated string to the stdout.
Sample TestCase 1
Input
Hello
Techgig
Output
HelloTechgig
Solution
import sys
def main():
# Write code here
ip1=raw_input()
ip2=raw_input()
sys.stdout.write(str(ip1).strip(" ")+str(ip2).strip(" "))
main()
You just need to take two strings as input from stdin and concatenate them and print the concatenated string to the stdout.
Input Format
You will be taking two strings as an input from stdin one on each line respectively.
Constraints
1 <= |S| <= 10000
Output Format
You need to print the concatenated string to the stdout.
Sample TestCase 1
Input
Hello
Techgig
Output
HelloTechgig
Solution
import sys
def main():
# Write code here
ip1=raw_input()
ip2=raw_input()
sys.stdout.write(str(ip1).strip(" ")+str(ip2).strip(" "))
main()
Comments
Post a Comment