Skip to content

prasyever/30-Days-of-Python-Code

Repository files navigation

30-Days-of-Python-Code 👍

Improve your coding skills with 30 Days of Code. You’ll be surprised at how much you can learn by coding for 30 days straight.Topics include if-then-else statements, recursion, data structures, object-oriented programming, running time, and testing. Thanks to https://www.hackerrank.com

Day 0: Hello, World

To complete this challenge, you must save a line of input from stdin to a variable, print Hello, World. on a single line, and finally print the value of your variable on a second line. You've got this!

Note: The instructions are Java-based, but we support submissions in many popular languages. You can switch languages using the drop-down menu above your editor, and the inputString variable may be written differently depending on the best-practice conventions of your submission language.

Input Format : A single line of text denoting inputString (the variable whose contents must be printed).

Output Format : Print Hello, World. on the first line, and the contents of inputString on the second line.

Solution : Refer day_0.py file

Day 1: Data Types

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:
    1. Print the sum of plus your int variable on a new line.
    2. Print the sum of plus your double variable to a scale of one decimal place on a new line.
    3. Concatenate with the string you read as input and print the result on a new line.

Input Format :

The first line contains an integer that you must sum with i. The second line contains a double that you must sum with d. The third line contains a string that you must concatenate with s.

Output Format :

Print the sum of both integers on the first line, the sum of both doubles (scaled to 1 decimal place) on the second line, and then the two concatenated strings on the third line.

Sample Input

12
4.0
is the best place to learn and practice coding!

Sample Output

16
8.0
HackerRank is the best place to learn and practice coding!

Solution : Refer day_1.py file

About

Improve your coding skills with 30 Days of Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages