You are viewing a single comment's thread. Return to all comments →
i = 4 d = 4.0 s = 'HackerRank '
i2 = input() d2 = input() s2 = input()
print(i + int(i2))
print(d + float(d2))
print (s + str(s2))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 1: Data Types
You are viewing a single comment's thread. Return to all comments →
i = 4 d = 4.0 s = 'HackerRank '
Declare second integer, double, and String variables.
i = 4 d = 4.0 s = 'HackerRank '
Read and save an integer, double, and String to your variables.
i2 = input() d2 = input() s2 = input()
Print the sum of both integer variables on a new line.
print(i + int(i2))
Print the sum of the double variables on a new line.
print(d + float(d2))
Concatenate and print the String variables on a new line
The 's' variable above should be printed first.
print (s + str(s2))