Loading...
More Python Posts
# Prompt user for base and heightbase = float(input("Enter the base of the triangle: "))height = float(input("Enter the height of the triangle: "))# Calculate the areaarea = (base * height) / 2# Display the resultprint("The area of the triangle is:", area)
import itertoolsdef compute_permutations(string):# Generate all permutations of the stringpermutations = itertools.permutations(string)# Convert each permutation tuple to a stringpermutations = [''.join(permutation) for permutation in permutations]return permutations# Prompt the user for a stringstring = input("Enter a string: ")# Compute permutationspermutations = compute_permutations(string)# Display the permutationsprint("Permutations:")for permutation in permutations:print(permutation)
import pandas as pdx = pd.read_excel(FILE_NAME)print(x)
x[cat_var].isnull().sum().sort_values(ascending=False)
import mathdef factorial(n):print(math.factorial(n))return (math.factorial(n))factorial(5)factorial(10)factorial(15)
print("test")