Skip to content

fenyx-it-academy/vit-en-python4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

vit-en-python4

Question-1

Write a Python program that finds the repeating elements in a list containing a sequence. Try to use Python sets to solve this question.

Sample Input:

1 2 3 4 12 45 1 2 54 65 77 8 1 2

Sample Output:

Repeating elements: {1, 2}

Question-2

Create a restaurant menu using Python dictionaries and allow the user to order dishes.

You can follow these steps:

Create the restaurant's menu as a Python dictionary. Each dish can be defined as a key, with its price as the value. Print the menu on the screen for the user to view. Ask the user to order dishes. The user can enter a dish name or number. Store the dishes selected by the user in a dictionary. Print the user's orders on the screen and calculate the total price.

BONUS

Write a program that allows the user to enter a text and then converts this text into Morse code and prints it, or similarly, takes Morse code and converts it back into text. You can use the following Morse code dictionary.

MORSE_CODE_DICT = {'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': '--..', '1': '.----', '2': '..---', '3': '...--', '4': '....-', '5': '.....', '6': '-....', '7': '--...', '8': '---..', '9': '----.', '0': '-----', ', ': '--..--', '.': '.-.-.-', '?': '..--..', '/': '-..-.', '-': '-....-', '(': '-.--.', ')': '-.--.-'}

Sample Input:

Entry a text: Fenyx IT Academy

Sample Output:

Morse code: ..-. . -. -.-- -..- .. - .- -.-. .- -.. . -- -.--

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published