30 Days of Code — Day 1

Tyler Carter
1 min readMar 8, 2021

--

Photo by Shahadat Rahman on Unsplash

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

  1. Declare variables: one of type int, one of type double, and one of type String.
  2. Read lines of input from stdin (according to the sequence given in the Input Format section below) and initialize your variables.
  3. 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

--

--

Tyler Carter
0 Followers

I am currently an Operations Program Manager for Microsoft. I have been teaching myself Python to use for Data Analytics and Machine Learning.