Skip to content

Commit bc3c1d0

Browse files
initial commit
1 parent 52102bf commit bc3c1d0

8 files changed

Lines changed: 118 additions & 6 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function Person(initialAge) {
2+
// Add some more code to run some checks on initialAge
3+
if (initialAge < 0) {
4+
console.log("Age is not valid, setting age to 0.");
5+
this.age = 0;
6+
} else {
7+
this.age = initialAge;
8+
}
9+
this.amIOld = function () {
10+
// Do some computations in here and print out the correct statement to the console
11+
if (this.age < 13) {
12+
console.log('You are young.');
13+
} else if (this.age >= 13 && this.age < 18) {
14+
console.log("You are a teenager.");
15+
} else {
16+
console.log('You are old.');
17+
}
18+
};
19+
this.yearPasses = function () {
20+
// Increment the age of the person in here
21+
this.age += 1;
22+
};
23+
}

JavaScript/Day5 Loops.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function main() {
2+
const n = parseInt(readLine(), 10);
3+
for (let i = 1; i < 11; i++) {
4+
console.log(`${n} x ${i} = ${n*i}`)
5+
}
6+
}

JavaScript/Day6 Let's Review.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
function processData(input) {
2+
//Enter your code here
3+
input = input.split('\n')
4+
5+
for(let i=1;i<input.length;i++){
6+
var splitWord = input[i].split('');
7+
8+
var even = '';
9+
var odd = '';
10+
11+
for(x=0;x<splitWord.length;x++){
12+
if(x%2==0){
13+
even = even + splitWord[x];
14+
}else{
15+
odd = odd +splitWord[x];
16+
}
17+
}
18+
console.log(even + ' '+ odd);
19+
}
20+
}

Python/Day4 Class vs. Instance.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Person:
2+
def __init__(self,initialAge):
3+
# Add some more code to run some checks on initialAge
4+
if (initialAge<0):
5+
print("Age is not valid, setting age to 0.")
6+
self.age = 0
7+
else:
8+
self.age = initialAge
9+
def amIOld(self):
10+
if self.age<13:
11+
print('You are young.')
12+
elif 13<=self.age<18:
13+
print("You are a teenager.")
14+
else:
15+
print('You are old.')
16+
# Increment the age of the person in here
17+
def yearPasses(self):
18+
# Increment the age of the person in here
19+
self.age +=1

Python/Day5 Loops.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if __name__ == '__main__':
2+
n = int(input())
3+
for i in range(1,11):
4+
print(f'{n} x {i} = {n*i}')
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Enter your code here. Read input from STDIN. Print output to STDOUT
2+
# read the input
3+
4+
5+
def solution(string):
6+
even = ''
7+
odd = ''
8+
for j in range(len(string)):
9+
if(j%2==0):
10+
even = even + string[j]
11+
else:
12+
odd = odd + string[j]
13+
print(even+ ' '+ odd)
14+
15+
N = int(input())
16+
for i in range(0, N):
17+
string = input()
18+
19+
solution(string)

Python/Day6 Let's Review.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Enter your code here. Read input from STDIN. Print output to STDOUT
2+
# read the input
3+
N = int(input())
4+
for i in range(0, N):
5+
string = input()
6+
7+
for j in range(0,len(string)):
8+
if j %2 ==0:
9+
print(string[j],end='')
10+
print(" ",end='')
11+
12+
for j in range(0,len(string)):
13+
if j%2 !=0:
14+
print(string[j],end='')
15+
16+
print('')

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# [10DaysOfJavaScript](https://www.hackerrank.com/domains/tutorials/10-days-of-javascript)
1+
# [30-DaysOfCode-With-Python-And-JavaScript](https://www.hackerrank.com/domains/tutorials/30-days-of-code)
22

3-
- [10DaysOfJavaScript](#10daysofjavascript)
3+
- [30-DaysOfCode-With-Python-And-JavaScript](#30-daysofcode-with-python-and-javascript)
44
- [Introduction](#introduction)
5+
- [Get Started](#get-started)
56
- [Difficulty Level](#difficulty-level)
67
- [Usage](#usage)
78
- [Support](#support)
@@ -13,8 +14,12 @@
1314

1415
## Introduction
1516

16-
- HackerRank 10DaysOfJavaScript Challenge.
17-
- Check [10DaysOfJavaScript](https://www.hackerrank.com/domains/tutorials/10-days-of-javascript) Challenge.
17+
- HackerRank 30-DaysOfCode-With-Python-And-JavaScript
18+
- Check [30-DaysOfCode-With-Python-And-JavaScript](https://www.hackerrank.com/domains/tutorials/30-days-of-code) Challenge.
19+
20+
## Get Started
21+
22+
Download [Python 3](https://python.org/downloads)
1823

1924
## Difficulty Level
2025

@@ -57,8 +62,8 @@ For open-source projects, Under MIT License.
5762

5863
## Author
5964

60-
- Project: [10DaysOfJavaScript](https://www.hackerrank.com/domains/tutorials/10-days-of-javascript)
65+
- Project: [30-DaysOfCode-With-Python-And-JavaScript](https://www.hackerrank.com/domains/tutorials/30-days-of-code)
6166
- Author: CodePerfectPlus
62-
- Language: JavaScript
67+
- Language: JavaScript And Python
6368
- Github: <https://github.com/codePerfectPlus>
6469
- Website: <http://codeperfectplus.github.io/>

0 commit comments

Comments
 (0)