My issue
i am getting crct output , but it is showing as runtime error
My code
# Importing necessary modules
import random # For generating random numbers
import string # For accessing string constants and helper functions
N=int(input())
# Define a string containing the characters to choose from for the password
string_char = 'abcdefgh'
string_spl='!@#$%^&*?'
# Initialize an empty string to hold the generated password
password = ''
# Loop 4 times to generate 4 characters for the password
for _ in range(N-2):
# Randomly choose one character from the string_char and append it to the password
password += random.choice(string_char)
k=input()
if k=='yes':
password += str(random.randint(0,9))
else:
password += random.choice(string_char)
g=input()
if g=='yes':
password += random.choice(string_spl)
else:
password += random.choice(string_char)
# Print the generated password
print(password)
Learning course: Build Projects using Python
Problem Link: Project - Password generator Practice Problem in Build Projects using Python - CodeChef