File tree Expand file tree Collapse file tree 7 files changed +42
-41
lines changed
Expand file tree Collapse file tree 7 files changed +42
-41
lines changed Original file line number Diff line number Diff line change 33Subdomain : Introduction
44Domain : Python
55Author : Ahmedur Rahman Shovon
6- Created : 15 July 2016
6+ Created : 15 April 2020
77Problem : https://www.hackerrank.com/challenges/python-arithmetic-operators/problem
88'''
9- # Enter your code here. Read input from STDIN. Print output to STDOUT
10- a = int (raw_input ())
11- b = int (raw_input ())
12- print a + b
13- print a - b
14- print a * b
9+ if __name__ == '__main__' :
10+ a = int (input ())
11+ b = int (input ())
12+ print ( a + b )
13+ print ( a - b )
14+ print ( a * b )
Original file line number Diff line number Diff line change 33Subdomain : Introduction
44Domain : Python
55Author : Ahmedur Rahman Shovon
6- Created : 15 July 2016
6+ Created : 13 May 2020
77Problem : https://www.hackerrank.com/challenges/python-loops/problem
88'''
9- # Enter your code here. Read input from STDIN. Print output to STDOUT
10- a = int (raw_input ())
11- for i in range (0 ,a ):
12- print i * i
9+ if __name__ == '__main__' :
10+ n = int (input ())
11+ for i in range (n ):
12+ print (i * i )
13+
Original file line number Diff line number Diff line change 33Subdomain : Introduction
44Domain : Python
55Author : Ahmedur Rahman Shovon
6- Created : 15 July 2016
6+ Created : 06 July 2020
77Problem : https://www.hackerrank.com/challenges/python-print/problem
88'''
9- n = int (input ())
10- ar = range (1 ,n + 1 )
11- for i in ar :
12- print (i ,end = "" )
9+
10+ if __name__ == '__main__' :
11+ n = int (input ())
12+ ar = range (1 ,n + 1 )
13+ for i in ar :
14+ print (i ,end = "" )
15+
16+ """
17+ Alternate solution:
18+
19+ if __name__ == '__main__':
20+ n = int(input())
21+ print("".join([str(i) for i in range(1,n+1)]))
22+
23+ """
Original file line number Diff line number Diff line change 33Subdomain : Introduction
44Domain : Python
55Author : Ahmedur Rahman Shovon
6- Created : 15 July 2016
6+ Created : 06 July 2020
77Problem : https://www.hackerrank.com/challenges/python-division/problem
88'''
9- # Enter your code here. Read input from STDIN. Print output to STDOUT
10- a = int (raw_input ())
11- b = int (raw_input ())
12- print a / b
13- c = float ( a )
14- print c / b
9+ if __name__ == '__main__' :
10+ a = int (input ())
11+ b = int (input ())
12+ print ( a // b )
13+ print ( a / b )
14+
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33Subdomain : Introduction
44Domain : Python
55Author : Ahmedur Rahman Shovon
6- Created : 15 July 2016
6+ Created : 06 July 2020
77Problem : https://www.hackerrank.com/challenges/write-a-function/problem
88'''
99def is_leap (year ):
10- leap = False
11- if (year % 400 == 0 ):
12- leap = True
13- elif year % 4 == 0 and year % 100 != 0 :
14- leap = True
10+ leap = False
11+ leap = (year % 400 == 0 ) or (year % 4 == 0 and year % 100 != 0 )
1512 return leap
13+
14+ year = int (input ())
15+ print (is_leap (year ))
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ My solutions of <strong>Hackerrank Python Domain</strong> challenges. The codes
1919
2020- Introduction
2121 - [ Say Hello, World! With Python] ( Introduction/SayHelloWorldWithPython.py )
22- - [ Reading Raw Input] ( Introduction/ReadingRawInput.py )
2322 - [ Python If-Else] ( Introduction/PythonIfElse.py )
2423 - [ Arithmetic Operators] ( Introduction/ArithmeticOperators.py )
2524 - [ Python: Division] ( Introduction/PythonDivision.py )
You can’t perform that action at this time.
0 commit comments