1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zepelin [54]
3 years ago
15

Write a program that will generate a personalized invitation within a text file for each guest in the guest list file using the

event information found in the event details file. Put all the generated invitation files in a directory called invitations. Ensure that the name of each invitation file uniquely identifies each guest's invitation
Computers and Technology
1 answer:
vlada-n [284]3 years ago
7 0

Answer:

Code:  

import os   # os module to create directory  

event_file = open("event_details.txt", "r") # Getting event file  

event_details = ""  # event details to be stored  

for row in event_file:  # traversing through the event_file  

   event_details += row    # appending event details  

os.mkdir("./invitations")   # make directory in the same parent directory  

names = open("guest_list.txt", "r") # getting names of the people  

for name in names:  # traversing through names in guest_list file

   name = name.replace('\n', '')   # removing the ending '\n' from the name  

   invitation_msg = "Hi! " + name + ", You are heartly invited in the Ceremony.\nAt " + event_details # Generating the invitation message  

   file_name = '_'.join(name.split(' '))   # Spliting name in space and joining with the '_'  

   file_path = "./invitations/" + file_name + ".txt" # Generating each file path  

   invite_file = open(file_path, "w")  # Creating the file for each name  

   invite_file.write(invitation_msg)   # Write invitation to file

Output:

You might be interested in
I got enough points and enough brainliests how do I move on to my next rank?
emmasim [6.3K]

Answer: what do you mean exactly?

6 0
3 years ago
Read 2 more answers
What is the Moore's law
Nadya [2.5K]

Answer:

Hi, in the law of Moore we can express aproxitmaly for each <em>two years</em> is duplicated the number of transitors in a microprocessor.

Explanation:

In around 26 years the number of transitors has increased about 3200 times, a transitor is a way to regulate the current voltage flow and can be act like a <em>switch</em> for an electronic signal.

I hope it's help you.

4 0
3 years ago
Can you help please ill give branilist
konstantin123 [22]

HTML uses tags to help the computer know what different pieces of content in the web page actually are. Right now we've only learned how to tell the computer that some text is a paragraph, or that part of your website is the body. We've already seen how that affects the way our web pages look and are structured.

(I don't know how it should be organized, but hope this helped)

3 0
2 years ago
What two items must be given to the socket function in order to create a socket object? A) The socket type that will be used. B)
Yuki888 [10]

Answer:

The correct option are:-

a) The socket type that will be used

d) The socket family that will be used  

Explanation:

The socket() method generates the unbound socket in a networking domain and returns a descriptor of the register, which can be used in subsequent socket function calls.

The socket() method takes three arguments:  

Domain:- The domain for which a socket is to be built is defined.

Type:- The socket type to be generated is defined.

Protocol:- It specifies a common socket protocol to use. The protocol setting of 0 causes socket() to use a default uninstalled protocol that is suitable for the socket type requested.

5 0
3 years ago
Write a program that computes and prints the average of the numbers in a text file. You should make use of two higher-order func
lara [203]

Answer:import functools

# open your file

file = open("integers.txt", 'r')

file = file.read()

# put numbers into a list

file = file.split()

# convert list into integers

file = list(map(int, file))

# use lambda function to get average.

print(functools.reduce(lambda x, y: x+y / len(file), file, 0))

Explanation:

4 0
2 years ago
Other questions:
  • What is the LER for a rectangular wing with a span of 0.225m and a chord of 0.045m
    12·1 answer
  • Blurring in a photograph can be due to _____ or ______.
    14·2 answers
  • What are five features of word 2016 you would use to capture the attention of the target audience? Defend you decisions
    9·1 answer
  • In 2-3 paragraphs, identify at least two ways technology and innovation have affected global economic competition. Provide a spe
    5·1 answer
  • The region which satisfies all of the constraints in graphical linear programming is called the:
    8·1 answer
  • Which statement will properly start the main() function? def main(): def Main def main# def main[]
    14·2 answers
  • HTML is the authoring language developed to create web pages and define structure and layout of a web document
    13·2 answers
  • 3. Radheshree has to complete her assignment and submit it on the next day. While typing
    9·1 answer
  • What is the initial condition in this set of code?
    8·1 answer
  • What are the different elements of a window?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!