import random import string password='' print('welcome to password generator') words=[random.choice(string.ascii_letters) for i in range(int(input('enter how many letters')))] numbers=[random.choice(string.digits) for i in range(int(input('enter how many numbers')))] symbol=[random.choice(string.punctuation) for i in range(int(input('enter how many symbols')))] key=words+numbers+symbol random.shuffle(key) for i in key: password=password+i print(password)
I used random.choices and set K= user input to generate random characters from letters, numbers and symbols in the easy part. In the hard part, I updated the lists into a set and printed the set since I knew that it would shuffle its contents randomly.
we can give directly in range function the value as n-letters , n_symbols without starting from 1 it will directly run the loop for the same number of letters or symbols that user will give
import random import string print ('Welcome to password generator') n = int(input('How many numbers do you want ? ')) l = int(input("How many letters do you want ? ")) c = int(input("How many capital letters do you want ? ")) s = int(input('How many symbols do you want to have in your password ? ')) letters = random.choices(string.ascii_lowercase, k = l) cap = random.choices(string.ascii_uppercase, k = c) r = random.choices(range(0, 10), k = n) sym = random.choices(string.punctuation, k = s) p = (letters + r + sym + cap) random.shuffle(p) for item in p: print (item, end = '')
Easy steps for layman to understand the Program Coding: It first imports the random module, which is used to generate random numbers or select items at random. It then defines lists of lowercase and uppercase letters, numbers, and special symbols. The program prompts the user to enter the number of letters, symbols, and numbers they want in their password. It then generates a list of characters for the password. It does this by randomly selecting the specified number of letters, symbols, and numbers from the respective lists and adding them to the password_list. The random.shuffle function is used to shuffle the characters in the password_list to ensure the password is random and not predictable (i.e., it doesn’t just have all the letters first, then the symbols, then the numbers). Finally, it joins all the characters in the password_list into a single string and prints the generated password. So, if you run this program and follow the prompts, it will generate a random password for you based on your specifications. This can be useful for creating secure passwords. Please remember to always keep your passwords safe and secure! 🔒
import random print("Welcome to the Password Generator!") letters=int(input("How many letters you want in your password? ")) symbols=int(input("How many symbols you want in your password? ")) numbers=int(input("How many numbers you want in your password? ")) if((letters
Mam please respond mam 🙏🙏🙏🙏🙏🙏🙏🙏😭😭😭😭😭 when will you continue C++ series mam.. completed C and eagerly waiting for C++ please continue mam upload full course 🥺🥺🙏🙏🥺🙏🙏🥺🙏
Di, I am clear 12th class this year. (I am waiting result). I want to study AI and machine Learning. What, I am doing? Next Means that what course and program I chose. To become a AI and machine learning expert.
Instead of typing all alphabets u can use this : import random letter=[] for i in range(ord('a'), ord('z')+1): letter.append(chr(i)) for i in range(ord('A'), ord('Z')+1): letter.append(chr(i)) print(letter) number=[] for i in range(10): number.append(i) number[i]=str(number[i]) print(number) symbol=['!','@','#','$','%','&','*','(',')','+'] print("Welcome to the passworrd generator.") letters=int(input("How many letters would you like in your password? ")) numbers=int(input("How many numbers would you like? ")) symbols=int(input("How many symbols would you like? ")) password_list=[] for i in range(1,letters+1): a=random.choice(letter) password_list+=a for i in range(1,numbers+1): b=random.choice(number) password_list+=b for i in range(1,symbols+1): c=random.choice(symbol) password_list+=c random.shuffle(password_list) password="" for i in password_list: password+=i print(password)
Hello Pycharm is giving me this error: NameError: name 'n_letter' is not defined. Did you mean: 'letter'? I don't know why I have defined my variable properly but I am getting this error.
import random import string print("Welcome to Password Generator!") password=[] a=int(input("Enter how many letters would you like in password:")) for i in range(a): rand_alphabet=random.choice(string.ascii_letters) password.append(rand_alphabet) b=int(input("Enter how many symbols would you like:")) for j in range(b): rand_symbol=random.choice(string.punctuation) password.append(rand_symbol) c=int(input("Enter how many numbers would you like:")) for k in range(c): rand_num=str(random.randint(0,9)) password.append(rand_num) random.shuffle(password) result=''.join(password) print(result)
import random f_list = [] list1 = ['q','l','r','w'] a = random.choice(list1) f_list += a # Here f_list is a list and a is of type string format, so how concatenation takes place print(f_list) But why it is giving different output, could you please check and validate? Thanks in advance sir/mam, If you explain earlier... Anyone who observed my comment is going to answer should be highly appreciated..
import random import string print("welcome to the password generator") password = "" a = int(input("how many letters do you want:")) b = string.ascii_letters for i in range(0,a): king = random. choice(b) password = password + king d = int(input("how many symbols do you want:")) e = string.punctuation for i in range(0, d): queen = random. choice(e) password = password + queen f = int(input("how many digits do you want:")) g = string.digits for i in range(0, f): jack = random. choice(g) password = password + jack else: print("your password is:",password)
17:35 ,I am trying with list but it is showing 'can only concatinate list(not "str" ) to list . I can understand this error . But how can we add elements to a list without using append?
import random import string password='' print('welcome to password generator') words=int(input("how many letters:-")) num=int(input("how many num:-")) symbol=int(input("how many symbol:-")) for i in range(1,words+1): char=random.choice(string.ascii_letters) password+=char for i in range(1,num+1): char=random.choice(string.digits) password+=char for i in range(1,symbol+1): char=random.choice(string.punctuation) password+=char password_list=list(password) random.shuffle(password_list) shuffled_password="".join(password_list) print(shuffled_password)
import random import string list1 = [] list2 = [] list3 = [] password = '' user1 = int(input("how many digits do you want for password? ")) for digits in range(user1): digits = list1.append(random.choice(string.digits)) user2 = int(input("how many symbols do you want for password? ")) for symbols in range(user2): symbols = list2.append(random.choice(string.punctuation)) user3 = int(input("how many chars do you want for password? ")) for chars in range(user3): chars = list3.append(random.choice(string.ascii_letters)) key = list1 + list2 + list3 random.shuffle(key) for i in key: password += i print(password)
import random import string x = int(input('how many letters should includ?')) y = int(input('how many symbols should includ?')) z = int(input('how many numbers should includ?')) password = [] for i in range(x): random_letter = random.choice(string.ascii_letters) password.append(random_letter) for i in range(y): random_symbol = random.choice(string.punctuation) password.append(random_symbol) for i in range(z): random_integer = random.randint(0, 10) password.append(random_integer) key = password[:] random.shuffle(key) shuffeld_key = ''.join(map(str, key)) print(shuffeld_key)
#Password generator program import random print("Welcome, to the password generator.") letrs = int(input("Please, enter how many letters you want in your password: ")) numsins = int(input("Please, enter how many numbers you want in your password: ")) symb = int(input("Please, enter how many symbols you want in your password: ")) letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] nums = ['0','1','2','3','4','5','6','7','8','9'] symbols = ['!','@','#','$','%','^','&','*','(',')','','?','/',':',';','{','[','}',']','|','+','=','-','_'] password = "" for i in range(0,letrs): password += random.choice(letters) for i in range(0, numsins): password += random.choice(nums) for i in range(0, symb): password += random.choice(symbols) #print(type(password)) #print(password) list_password = list(password) #because shuffle only works on mutable sequences and doesn't work on strings which are immutable #print(list_password) #print(type(list_password)) random.shuffle(list_password) #print(list_password) final_pw = '' for i in list_password: #to remove the commas and the square brackets and display as plain string final_pw += i print(f"Your password is: {final_pw}")
I have written directly with random.sample instead of For loop 3 times import random alphabets_num = input("how many alphabets you want for the password: ") alphabets = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] random_alphabets = random.sample(alphabets, int(alphabets_num)) print(random_alphabets) numbers_num = input("how many numbers you want for the password: ") numbers = ["1","2","3","4","5","6","7","8","9","0"] random_numbers = random.sample(numbers,int(numbers_num)) print(random_numbers) splchar_num = input("how many special characters you want for the password: ") splchars = ["!","@","#","$","%","&","*",":","?"] random_splchar = random.sample(splchars, int(splchar_num)) print(random_splchar) password = random_alphabets + random_numbers +random_splchar random_pass = "" for i in password: random_pass = random_pass + i print(random_pass)
import random """Password genarator""" small=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] caps=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] special=['!', '"', '#', '$', '%', '&', "'", '(', ')', '*'] numbers=[1,2,3,4,5,6,7,8,9,10] choice1=int(input("how many small charecters you need your password")) choice2=int(input("how many Capital charecters you need your password")) choice3=int(input("how many special charecters you need your password")) choice4=int(input("how many numbers charecters you need your password")) random1=[random.choice(small) for _ in range(choice1)] random2=[random.choice(caps) for _ in range(choice2)] random3=[random.choice(special) for _ in range(choice3)] random4=[random.choice(numbers) for _ in range(choice1)] password=random1+random2+random3+random4 print("your password is") for i in password: print(i,end="")
import random f_list = [] list1 = ['q','l','r','w'] a = random.choice(list1) f_list += a # Here f_list is a list and a is of type string format, so how concatenation takes place print(f_list) But why it is giving different output, could you please check and validate? Thanks in advance sir/mam, If you explain earlier... Anyone who observed my comment is going to answer should be highly appreciated..
import random
import string
password=''
print('welcome to password generator')
words=[random.choice(string.ascii_letters) for i in range(int(input('enter how many letters')))]
numbers=[random.choice(string.digits) for i in range(int(input('enter how many numbers')))]
symbol=[random.choice(string.punctuation) for i in range(int(input('enter how many symbols')))]
key=words+numbers+symbol
random.shuffle(key)
for i in key:
password=password+i
print(password)
Thank u mam for ur wonderful presentation.
Mam thanks for your class then I will your video and I will learn the python course
Thank you so much mam please continue python mam
Mam I've made GUI base one but that doesn't ask for such conditions 😂
I loved this one and can't wait to try this soon❤❤
Thank You Excellent Mam
Mam,Thankyou very much for coming back 🎉🎉🎉
I used random.choices and set K= user input to generate random characters from letters, numbers and symbols in the easy part.
In the hard part, I updated the lists into a set and printed the set since I knew that it would shuffle its contents randomly.
Thank you mam and we love you❤ you are very useful to us
Appreciated 💯💯
Di please continue your dbms series..
Call him mam❤❤❤
@@coding_with_bf her
Tnx Jenny mam interesting project you teach 😘👏👏
Thanks ❤
Cuteness overloaded💓
Mam, please continue c++ series mam.. We are waiting
we can give directly in range function the value as n-letters , n_symbols without starting from 1 it will directly run the loop for the same number of letters or symbols that user will give
thanks for this project
i love your think sister.
import random
import string
print ('Welcome to password generator')
n = int(input('How many numbers do you want ? '))
l = int(input("How many letters do you want ? "))
c = int(input("How many capital letters do you want ? "))
s = int(input('How many symbols do you want to have in your password ? '))
letters = random.choices(string.ascii_lowercase, k = l)
cap = random.choices(string.ascii_uppercase, k = c)
r = random.choices(range(0, 10), k = n)
sym = random.choices(string.punctuation, k = s)
p = (letters + r + sym + cap)
random.shuffle(p)
for item in p:
print (item, end = '')
Easy steps for layman to understand the Program Coding:
It first imports the random module, which is used to generate random numbers or select items at random.
It then defines lists of lowercase and uppercase letters, numbers, and special symbols.
The program prompts the user to enter the number of letters, symbols, and numbers they want in their password.
It then generates a list of characters for the password. It does this by randomly selecting the specified number of letters, symbols, and numbers from the respective lists and adding them to the password_list.
The random.shuffle function is used to shuffle the characters in the password_list to ensure the password is random and not predictable (i.e., it doesn’t just have all the letters first, then the symbols, then the numbers).
Finally, it joins all the characters in the password_list into a single string and prints the generated password.
So, if you run this program and follow the prompts, it will generate a random password for you based on your specifications. This can be useful for creating secure passwords. Please remember to always keep your passwords safe and secure! 🔒
import random
print("Welcome to the Password Generator!")
letters=int(input("How many letters you want in your password?
"))
symbols=int(input("How many symbols you want in your password?
"))
numbers=int(input("How many numbers you want in your password?
"))
if((letters
Tq so much mam
I hadMissed your lecture that bad😀
Mam please respond mam 🙏🙏🙏🙏🙏🙏🙏🙏😭😭😭😭😭 when will you continue C++ series mam.. completed C and eagerly waiting for C++ please continue mam upload full course 🥺🥺🙏🙏🥺🙏🙏🥺🙏
Di, I am clear 12th class this year. (I am waiting result).
I want to study AI and machine Learning.
What, I am doing? Next
Means that what course and program I chose.
To become a AI and machine learning expert.
Do Charted account bro
@LORD SOUMYA
How u do this
Tell me what is the next step for me
Output of this code is coming in multiple lines not concatinate in one line how to fix it maam
Maam put video of sales insight of fmgc python project
Sister pls I want more projects on python plsplsssss
mam can we do random.choice thing before the for loop?
Old Jenny is back
Which software you are used in this tutorial mam ?
Can we not automate instead of having to manually enter numbers, letters and strings? Is there a way?
Instead of typing all alphabets u can use this :
import random
letter=[]
for i in range(ord('a'), ord('z')+1):
letter.append(chr(i))
for i in range(ord('A'), ord('Z')+1):
letter.append(chr(i))
print(letter)
number=[]
for i in range(10):
number.append(i)
number[i]=str(number[i])
print(number)
symbol=['!','@','#','$','%','&','*','(',')','+']
print("Welcome to the passworrd generator.")
letters=int(input("How many letters would you like in your password? "))
numbers=int(input("How many numbers would you like? "))
symbols=int(input("How many symbols would you like? "))
password_list=[]
for i in range(1,letters+1):
a=random.choice(letter)
password_list+=a
for i in range(1,numbers+1):
b=random.choice(number)
password_list+=b
for i in range(1,symbols+1):
c=random.choice(symbol)
password_list+=c
random.shuffle(password_list)
password=""
for i in password_list:
password+=i
print(password)
mam why are you add pasword_list(which is list)and char(which is string)
is this possible yo add string and list with the help of +=
Please provide the code files and the links in the description as soon as possible for free 🙏 thank you so much.
Mam whatever you teach , do you have pdf of this notes . So we can easily read them and watch you, without making self notes
Anyways passwords print only one letter ,😢😢😢.why?
Mam please complete c++ series🙏🙏🙏🙏
Mam I'm come from Instagram 😮
Can't we use join() instead of for loop
Hello Pycharm is giving me this error: NameError: name 'n_letter' is not defined. Did you mean: 'letter'? I don't know why I have defined my variable properly but I am getting this error.
Mam why don't you try to act in movies... ❤
Becoz we need her more
Don't waste ur time .invest ur time.
Dhruv Rathee followers think like this . Respect teachers
Hi, doubt: do we need to initialize variable here password with empty string ?? Is it mandatory in python and can anyone give a reason pls
import random
import string
print("Welcome to Password Generator!")
password=[]
a=int(input("Enter how many letters would you like in password:"))
for i in range(a):
rand_alphabet=random.choice(string.ascii_letters)
password.append(rand_alphabet)
b=int(input("Enter how many symbols would you like:"))
for j in range(b):
rand_symbol=random.choice(string.punctuation)
password.append(rand_symbol)
c=int(input("Enter how many numbers would you like:"))
for k in range(c):
rand_num=str(random.randint(0,9))
password.append(rand_num)
random.shuffle(password)
result=''.join(password)
print(result)
import random
f_list = []
list1 = ['q','l','r','w']
a = random.choice(list1)
f_list += a # Here f_list is a list and a is of type string format, so how concatenation takes place
print(f_list)
But why it is giving different output, could you please check and validate?
Thanks in advance sir/mam, If you explain earlier...
Anyone who observed my comment is going to answer should be highly appreciated..
Same doubt
Mam please start Java programming.....
Mam I love u so much ❤️
11:48
Hello ma'am
I have one query
Mam I want fitness tracker program
Mam when will you start Java mam
mam list can't be concatinate withstr
What is the use of password generator in real life time
import random
import string
print("welcome to the password generator")
password = ""
a = int(input("how many letters do you want:"))
b = string.ascii_letters
for i in range(0,a):
king = random. choice(b)
password = password + king
d = int(input("how many symbols do you want:"))
e = string.punctuation
for i in range(0, d):
queen = random. choice(e)
password = password + queen
f = int(input("how many digits do you want:"))
g = string.digits
for i in range(0, f):
jack = random. choice(g)
password = password + jack
else:
print("your password is:",password)
17:35 ,I am trying with list but it is showing 'can only concatinate list(not "str" ) to list . I can understand this error . But how can we add elements to a list without using append?
You can use extend instead of append
import random
import string
password=''
print('welcome to password generator')
words=int(input("how many letters:-"))
num=int(input("how many num:-"))
symbol=int(input("how many symbol:-"))
for i in range(1,words+1):
char=random.choice(string.ascii_letters)
password+=char
for i in range(1,num+1):
char=random.choice(string.digits)
password+=char
for i in range(1,symbol+1):
char=random.choice(string.punctuation)
password+=char
password_list=list(password)
random.shuffle(password_list)
shuffled_password="".join(password_list)
print(shuffled_password)
import random
import string
list1 = []
list2 = []
list3 = []
password = ''
user1 = int(input("how many digits do you want for password? "))
for digits in range(user1):
digits = list1.append(random.choice(string.digits))
user2 = int(input("how many symbols do you want for password? "))
for symbols in range(user2):
symbols = list2.append(random.choice(string.punctuation))
user3 = int(input("how many chars do you want for password? "))
for chars in range(user3):
chars = list3.append(random.choice(string.ascii_letters))
key = list1 + list2 + list3
random.shuffle(key)
for i in key:
password += i
print(password)
import random
import string
x = int(input('how many letters should includ?'))
y = int(input('how many symbols should includ?'))
z = int(input('how many numbers should includ?'))
password = []
for i in range(x):
random_letter = random.choice(string.ascii_letters)
password.append(random_letter)
for i in range(y):
random_symbol = random.choice(string.punctuation)
password.append(random_symbol)
for i in range(z):
random_integer = random.randint(0, 10)
password.append(random_integer)
key = password[:]
random.shuffle(key)
shuffeld_key = ''.join(map(str, key))
print(shuffeld_key)
import random
import string
letters = string.ascii_letters
digits = string.digits
special_chars = string.punctuation
alphabet = letters + digits + special_chars
print("welcome to password generator")
password_len = int(input("how many characters you want in your password"))
password = ""
for i in range(1,password_len+1):
char = random.choice(alphabet)
password+=char
print(password)
But it's not specific. If I want a password with only two characters, only two numbers and only 2 letters, It fails to provide it. Isn't it?
I love your teaching and your eyes I will come to India and I married with you love for Afghanistan ♥️🇦🇫
Your code will always skip
'a' '0' '!'
mam you are so beautiful
cutie patootiee
Mam you look like actress
#Password generator program
import random
print("Welcome, to the password generator.")
letrs = int(input("Please, enter how many letters you want in your password: "))
numsins = int(input("Please, enter how many numbers you want in your password: "))
symb = int(input("Please, enter how many symbols you want in your password: "))
letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
nums = ['0','1','2','3','4','5','6','7','8','9']
symbols = ['!','@','#','$','%','^','&','*','(',')','','?','/',':',';','{','[','}',']','|','+','=','-','_']
password = ""
for i in range(0,letrs):
password += random.choice(letters)
for i in range(0, numsins):
password += random.choice(nums)
for i in range(0, symb):
password += random.choice(symbols)
#print(type(password))
#print(password)
list_password = list(password) #because shuffle only works on mutable sequences and doesn't work on strings which are immutable
#print(list_password)
#print(type(list_password))
random.shuffle(list_password)
#print(list_password)
final_pw = ''
for i in list_password: #to remove the commas and the square brackets and display as plain string
final_pw += i
print(f"Your password is: {final_pw}")
I have written directly with random.sample instead of For loop 3 times
import random
alphabets_num = input("how many alphabets you want for the password: ")
alphabets = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
random_alphabets = random.sample(alphabets, int(alphabets_num))
print(random_alphabets)
numbers_num = input("how many numbers you want for the password: ")
numbers = ["1","2","3","4","5","6","7","8","9","0"]
random_numbers = random.sample(numbers,int(numbers_num))
print(random_numbers)
splchar_num = input("how many special characters you want for the password: ")
splchars = ["!","@","#","$","%","&","*",":","?"]
random_splchar = random.sample(splchars, int(splchar_num))
print(random_splchar)
password = random_alphabets + random_numbers +random_splchar
random_pass = ""
for i in password:
random_pass = random_pass + i
print(random_pass)
import random
letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V'
'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
symbols = ['!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+',
',', '-', '.', '/', ':', ';', '', '?', '@',
'[', '\\', ']', '^', '_', '`', '{', '|', '}', '~']
# print(letter)
# print(number)
print("Welcome to the password generator!")
required_letters = int(input("how many letters would you like in your password"))
required_numbers = int(input("how many numbers would you like in your password"))
required_symbols = int(input("how many symbols would you like in your password"))
generated = ""
for i in range(required_letters):
letter = random.choice(letters)
generated += f"{letter}"
for j in range(required_numbers):
number = str(random.randint(0, 9))
generated += f"{number}"
for k in range(required_symbols):
symbol = random.choice(symbols)
generated += f"{symbol}"
print(generated)
import random
"""Password genarator"""
small=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
caps=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
special=['!', '"', '#', '$', '%', '&', "'", '(', ')', '*']
numbers=[1,2,3,4,5,6,7,8,9,10]
choice1=int(input("how many small charecters you need your password"))
choice2=int(input("how many Capital charecters you need your password"))
choice3=int(input("how many special charecters you need your password"))
choice4=int(input("how many numbers charecters you need your password"))
random1=[random.choice(small) for _ in range(choice1)]
random2=[random.choice(caps) for _ in range(choice2)]
random3=[random.choice(special) for _ in range(choice3)]
random4=[random.choice(numbers) for _ in range(choice1)]
password=random1+random2+random3+random4
print("your password is")
for i in password:
print(i,end="")
import random
alpha=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z','A', 'B', 'C', 'D', 'E', 'F','G','H', 'I', 'J', 'K', 'L', 'M' ,'N', 'O' ,'P', 'Q' ,'R', 'S', 'T', 'U' ,'V','W', 'X', 'Y', 'Z']
num= ['0','1','2','3','4','5','6','7','8','9']
sym=['!','@','#','$','%','&','*']
l=[]
A=int(input('ENTER NO OF ALPHABETS'))
N=int(input('ENTER NO OF num'))
S=int(input('ENTER NO OF symbols'))
for i in range(0,A):
a= random.choice(alpha)
l.append(a)
for i in range(0,N):
n= random.choice(num)
l.append(n)
for i in range(0,S):
s= random.choice(sym)
l.append(s)
random.shuffle(l)
print(l)
import random
f_list = []
list1 = ['q','l','r','w']
a = random.choice(list1)
f_list += a # Here f_list is a list and a is of type string format, so how concatenation takes place
print(f_list)
But why it is giving different output, could you please check and validate?
Thanks in advance sir/mam, If you explain earlier...
Anyone who observed my comment is going to answer should be highly appreciated..
i am getting same error bro
f_list = " "
or f_list.append(a)