<file_sep>i = 4
d = 4.0
s = 'HackerRank '
val=int(input())
val1=float(input())
s1=input()
value=i+val
print(value)
value1=d+val1
print(value1)
stri=s+s1
print(stri)<file_sep># 30DaysOfCodePython
These are my solutions for 30 Days of code on HackerRank. I have solved these using Python. Feel free to use the code in your solutions or your projects.
<file_sep>#Stub code:
import math
import os
import random
import re
import sys

#Solution begins here:
if __name__ == '__main__':
    n = int(input())
    count = 0
    maxi = 0
    while n > 0:
        if n % 2 == 1:
            count += 1
        else:
            if count > maxi:
                maxi = count
            count = 0
        n=math.floor(n / 2)
    if count > maxi:
        maxi = count
    print(maxi)
<file_sep>numberOfEntries = int(input())
addressBook = {}
for entry in range(numberOfEntries):
    inputFromUser = list(map(str,input().split()))
    addressBook[inputFromUser[0]] = inputFromUser[1]
inputs = []
while True:
    try:
        inp = input()
        inputs.append(inp)
    except:
        break
for name in inputs:
    if name in addressBook:
        print(name + "="+ str(addressBook[name])) 
    else:
        print("Not found")
<file_sep>#Stub code:
import math
import os
import random
import re
import sys

#Solution begins here:
def solve(meal_cost, tip_percent, tax_percent):
    tip_cost = (meal_cost * tip_percent)/100
    tax_cost = (meal_cost * tax_percent)/100
    total_cost = meal_cost + tip_cost + tax_cost
    print(round(total_cost))

#Stub code:
if __name__ == '__main__':
    meal_cost = float(input())
    tip_percent = int(input())
    tax_percent = int(input())
    solve(meal_cost, tip_percent, tax_percent)
<file_sep>#Stub code:
import math
import os
import random
import re
import sys

#Solution begins here:
def hourGlass(mat,n):
    max = -99999999999999999
    for i in range(n-2):
        for j in range(n-2):
            sum = mat[i][j] + mat[i][j+1] + mat[i][j+2] + mat[i+1][j+1] + mat[i+2][j] + mat[i+2][j+1] + mat[i+2][j+2]
            if sum > max:
                max = sum
    return max

#Stub code:
if __name__ == '__main__':
    arr = []
    for _ in range(6):
        arr.append(list(map(int, input().rstrip().split(' '))))
    print(hourGlass(arr,6))
<file_sep>#Stub code:
import math
import os
import random
import re
import sys

#Solution begins here:
if __name__ == '__main__':
    n = int(input())
    for i in range(1,11):
        prod = n * i
        print(n,'x',i,'=',prod)
<file_sep>#Stub code:
import math
import os
import random
import re
import sys

#Solution begins here:
if __name__ == '__main__':
    n = int(input())
    arr = list(map(int, input().rstrip().split()))
    reversed_array = arr[::-1]
    output_string = ''
    for i in range(len(reversed_array)):
        output_string+= str(reversed_array[i]) + ' '
    print(output_string)
