Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Encrypting a word from a list

+3 votes
asked Feb 11, 2023 by malik (160 points)
I'm making a program for a competiton in my school and i need a way to encrypt a word from a list that i have made in python

example

listname=["name1","name2","name3"]

choose=random.choice(listname)

then i want the computer to encrypt the random word and then print it

please help because the due date is tommorow

3 Answers

0 votes
answered Feb 14, 2023 by phzin (140 points)
import random
name1 = input('name1:')
name2 = input('name2:')
name3= input('name3:')
listname = [name1,name2,name3]
choose = random.choice(listname)
print('the chosen student was', choose)
0 votes
answered Feb 15, 2023 by NEKKALAPU SHANMUKHA SURYATEJA (180 points)

import random

listname=["name1","name2","name3"]

choose=random.choice(listname)

print(f"computer print {choose}")

0 votes
answered Feb 15, 2023 by Peter Minarik (84,720 points)

What do you mean by encryption? There are quite a lot of encryption algorithms out there and you can even invent your own.

Python has support for various encryption algorithms off the shelf. Check out this.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...