• Nov 19, 2022 •CodeCatch
0 likes • 2 views
# Input for row and column R = int(input()) C = int(input()) # Using list comprehension for input matrix = [[int(input()) for x in range (C)] for y in range(R)]
• Nov 18, 2022 •AustinLeath
0 likes • 8 views
#question1.py def rose(n) : if n==0 : yield [] else : for k in range(0,n) : for l in rose(k) : for r in rose(n-1-k) : yield [l]+[r]+[r] def start(n) : for x in rose(n) : print(x) #basically I am printing x for each rose(n) file print("starting program: \n") start(2) # here is where I call the start function
0 likes • 6 views
# function which return reverse of a string def isPalindrome(s): return s == s[::-1] # Driver code s = "malayalam" ans = isPalindrome(s) if ans: print("Yes") else: print("No")
• Mar 10, 2021 •Skrome
0 likes • 1 view
color2 = (60, 74, 172) color1 = (19, 28, 87) percent = 1.0 for i in range(101): resultRed = round(color1[0] + percent * (color2[0] - color1[0])) resultGreen = round(color1[1] + percent * (color2[1] - color1[1])) resultBlue = round(color1[2] + percent * (color2[2] - color1[2])) print((resultRed, resultGreen, resultBlue)) percent -= 0.01
• Feb 26, 2023 •wabdelh
0 likes • 0 views
#84 48 13 20 61 20 33 97 34 45 6 63 71 66 24 57 92 74 6 25 51 86 48 15 64 55 77 30 56 53 37 99 9 59 57 61 30 97 50 63 59 62 39 32 34 4 96 51 8 86 10 62 16 55 81 88 71 25 27 78 79 88 92 50 16 8 67 82 67 37 84 3 33 4 78 98 39 64 98 94 24 82 45 3 53 74 96 9 10 94 13 79 15 27 56 66 32 81 77 # xor a list of integers to find the lonely integer res = a[0] for i in range(1,len(a)): res = res ^ a[i]
0 likes • 3 views
list_1 = [1,2,3,4,5,6,7,8,9] cubed = map(lambda x: pow(x,3), list_1) print(list(cubed)) #Results #[1, 8, 27, 64, 125, 216, 343, 512, 729]