• Sep 9, 2023 •AustinLeath
0 likes • 24 views
print("test")
• Jan 20, 2021 •Ntindle
0 likes • 4 views
print(“Hello World”)
• Nov 18, 2022 •AustinLeath
0 likes • 1 view
# List lst = [1, 2, 3, 'Alice', 'Alice'] # One-Liner indices = [i for i in range(len(lst)) if lst[i]=='Alice'] # Result print(indices) # [3, 4]
• Nov 19, 2022 •CodeCatch
0 likes • 0 views
# Deleting all even numbers from a list a = [1,2,3,4,5] del a[1::2] print(a)
• Feb 23, 2025 •hasnaoui1
0 likes • 7 views
print("hello world")
• May 31, 2023 •CodeCatch
0 likes • 2 views
import itertools def compute_permutations(string): # Generate all permutations of the string permutations = itertools.permutations(string) # Convert each permutation tuple to a string permutations = [''.join(permutation) for permutation in permutations] return permutations # Prompt the user for a string string = input("Enter a string: ") # Compute permutations permutations = compute_permutations(string) # Display the permutations print("Permutations:") for permutation in permutations: print(permutation)