30 Days of Code — Day 1
1 min readMar 8, 2021
As a forcing function to get myself into the habit of writing these articles — I have decided to write an article for each day of the 30 Days of Code challenge from Hacker Rank.
The Task
- Declare variables: one of type int, one of type double, and one of type String.
- Read lines of input from stdin (according to the sequence given in the Input Format section below) and initialize your variables.
- Use the + operator to perform the following operations:
*Print the sum of i plus your int variable on a new line.
*Print the sum of d plus your int variable on a new line.
*Concatenate s with the string you read as input and print the result on a new line.
The Code
The Result
>? 12
>? 4.00
>? Python
… 16
… 8.0
… HackerRank Python
Conclusion
The task was somewhat simple still, setting the dtype for the input before defining a simple calculation in a variable is something I have done many times before.
Here is a link to the day_0 answer/challenge I wrote about previously: 30 Days of Code — Day 0