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://www.hackerrank.com/challenges/python-lists | |
| if __name__ == '__main__': | |
| N = int(raw_input()) | |
| # s = str(N) | |
| list = [] | |
| for i in range(N): | |
| st = raw_input().split() |
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://www.hackerrank.com/challenges/python-tuples/submissions/code/38679638 | |
| if __name__ == '__main__': | |
| n = int(raw_input()) | |
| integer_list = map(int, raw_input().split()) | |
| t = tuple(integer_list) | |
| h = hash(t) | |
| print h |
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
| if __name__ == '__main__': | |
| x = int(raw_input()) | |
| y = int(raw_input()) | |
| z = int(raw_input()) | |
| n = int(raw_input()) | |
| print ([[i ,j ,k] for i in range( x +1) for j in range( y +1) for k in range( z +1) if ( i + j +k ) !=n] ) |
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
| amount = input() | |
| largestNum = list(map(int, input().split())) | |
| max_num = max(largestNum) | |
| while max(largestNum) == max_num: | |
| largestNum.remove(max(largestNum)) | |
| largestNum = max(largestNum) | |
| print (largestNum) |
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 swap_case(s): | |
| return "".join(map(str.swapcase, s)) | |
| #return s.swapcase() | |
| if __name__ == '__main__': | |
| s = raw_input() | |
| result = swap_case(s) | |
| print result |
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 split_and_join(line): | |
| # write your code here | |
| line = line.split(" ") | |
| return "-".join(line) |
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 print_full_name(a, b): | |
| print "Hello " + a + " " + b + "! You just delved into python." |
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 mutate_string(string, position, character): | |
| l = list(string) | |
| l[position] = character | |
| lst = "".join(l) | |
| return lst |
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 count_substring(string, sub_string): | |
| count = 0 | |
| for i in range(0, len(string)): | |
| if string[i:].startswith(sub_string): | |
| count += 1 | |
| return count | |
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
| if __name__ == '__main__': | |
| s = raw_input() | |
| print(any(map(lambda x: x.isalnum(), s))) | |
| print(any(map(lambda x: x.isalpha(), s))) | |
| print(any(map(lambda x: x.isdigit(), s))) | |
| print(any(map(lambda x: x.islower(), s))) | |
| print(any(map(lambda x: x.isupper(), s))) | |