This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test = int(input()) | |
| for i in range(test): | |
| n = int(input()) | |
| if len(str(n))==1: | |
| print(n) | |
| else: | |
| arr = [] | |
| for x in range(2,int(n/2)+2): | |
| if n%x==0: | |
| r = int(n/x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test = int(input()) | |
| for i in range(test): | |
| dmy = input().split() | |
| d = int(dmy[0]) | |
| m = int(dmy[1]) | |
| y = int(dmy[2]) | |
| day = ["Sunday", "Monday", "Tuesday", "Wednesday", | |
| "Thursday", "Friday", "Saturday"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def kthdigit(a,b,k): | |
| res = str(pow(a,b)) | |
| length = len(res)-k | |
| print(res[length]) | |
| return | |
| test = int(input()) | |
| for i in range(test): | |
| abk = input().split() | |
| a = int(abk[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def addFraction(num1, den1, num2, den2): | |
| from math import gcd | |
| num = num1*den2+num2*den1 | |
| den = den1*den2 | |
| ka=gcd(num,den) | |
| h=num//ka | |
| d=den//ka | |
| print(str(h)+"/"+str(d)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://practice.geeksforgeeks.org/problems/armstrong-numbers/0/?track=interview-mathematical | |
| import os | |
| import random | |
| import re | |
| import sys | |
| t = int(input()) | |
| for i in range(t): | |
| n = int(input()) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.