Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def test_case_1():
- ii = int()
- dd = float()
- ss = str()
- i = 4
- d = 4.0
- s = 'HackerRank '
- ii = 12
- dd = 4.0
- ss = "is the best place to learn and practice coding!"
- total_int = i + ii
- print (total_int)
- total_double = d + dd
- print(total_double)
- print (s + ss)
- memory = open('memory.txt', 'w')
- memory.write("1")
- memory.close()
- def test_case_2():
- ii = int()
- dd = float()
- ss = str()
- i = 4
- d = 4.0
- s = 'HackerRank '
- ii = 3
- dd = 2.8
- ss = "is my favorite plataform!"
- total_int = i + ii
- print (total_int)
- total_double = d + dd
- print(total_double)
- print (s + ss)
- memory = open('memory.txt', 'w')
- memory.write("0")
- memory.close()
- def starting():
- memory = open('memory.txt', 'r')
- ted = []
- for line in memory:
- ted.append(line)
- memory.close()
- return ted
- def test(ted, main):
- if ted == ['0'] :
- test_case_1()
- elif ted == ['1'] :
- test_case_2()
- def main():
- try:
- memory = open('memory.txt', 'r')
- memory.close()
- except:
- memory = open('memory.txt', 'w')
- memory.write("0")
- memory.close()
- pronto = starting()
- test(pronto, main)
- main()
- import sys
- i2 = int(sys.stdin.readline())
- d2 = float(sys.stdin.readline())
- s2 = sys.stdin.readline()
- # Print the sum of both integer variables on a new line.
- print(i+i2)
- # Print the sum of the double variables on a new line.
- print(d+d2)
- # Concatenate and print the String variables on a new line
- # The 's' variable above should be printed first.
- print(s+s2)
Add Comment
Please, Sign In to add comment