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
PtichkaEL [24]
3 years ago
11

Assignment 7: Random Joke Generator

Computers and Technology
1 answer:
fenix001 [56]3 years ago
5 0

Random Joke Generator is a code in which random jokes are generated everytime a button is pressed.

Explanation :

The code is written in python and shows random jokes everytime.

c = 0  

jokes = open("jokes.txt", "r")

line = jokes.readline()

while line:

   c = c + 1

   line = jokes.readline()

print(str(c) + " Jokes In File")

jokes.close()

jokes = open("jokes.txt")

answer = open("answers.txt")

pick = int(input("Which joke do you want to see?: "))

print("Joke #" + str(pick))

i = 0

joke =jokes.readline()

punch=answer.readline()

while joke:

   

   i = i + 1

   

   if(i==pick):

       print(joke, end= "")

       print(punch)

   else:

       joke= jokes.readline()

       punch=answer.readline()

You might be interested in
22. The Disc Drive is also known as the:
andrew11 [14]

Answer:

HDD Hard Disk Drive

Explanation:

3 0
3 years ago
the php function that is executed is a connection to a database cannot be made is the____ function. die | isset| end | connect.
Pepsi [2]

The PHP function that is executed is a connection to a database that cannot be made is the die() function.

An error is an undesirable programming outcome. The mistake is a subset of the error. Error management is a vital component of any website or programme.

Error handling is a mechanism for identifying errors that a programme makes and taking appropriate corrective action. This can be done by utilising die() method.

When a programming problem occurs, the software will halt further code execution and display the appropriate error message to the user. The die() function displays a message and terminates the running of the programme.

The connect() function in PHP is one that is used to establish a connection to a database.

The end() method in PHP is used to locate the final element of the specified array. The end() function updates an array's internal pointer to refer to the final element and returns that element's value.

The isset() function examines whether a variable is set, which implies that it has to be declared and is not NULL. If the variable is present and not NULL, this function will return true; otherwise, it will return false.

To learn more about PHP click here:

brainly.com/question/29740624

#SPJ4

4 0
2 years ago
The information of an management information system comes from?
Debora [2.8K]

A management information system is a computer system consisting of hardware and software that serves as the backbone of an organization's operations

5 0
2 years ago
Sarah needs help with a presentation that she is giving the next day. What are the best ways for her to share her work to get im
Papessa [141]

Answer:

Office365 with PowerPoint Online comment accessibility.

7 0
3 years ago
Read 2 more answers
A computer processes data using only 1s and 0s.<br><br> A.True<br><br> B.False
stiks02 [169]
True. That data is called binary
4 0
4 years ago
Other questions:
  • If a ≤m b and b is regular, does that imply that a is a regular language? why or why not?
    6·1 answer
  • Două numere a și b sunt numite generatoare ale unui număr natural n dacă a∙b+[a/b]=n, unde s-a notat cu [c] partea întreagă a nu
    7·1 answer
  • Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and
    5·1 answer
  • CIST 1122 Project 2 Instructions
    11·1 answer
  • Consider the problem of making change for n cents using the fewest number of coins. Assume that each coins value is an integer.
    7·1 answer
  • A social cause is: O A. when one person protests without the support of others. B. something that not many citizens think or car
    8·1 answer
  • You Could Never Size Me UP! Been Doing This Sh*t A Long ⏱time
    15·1 answer
  • (Java)
    11·2 answers
  • How to work a computer cause i don't know how to
    15·1 answer
  • Who is the traitor of UA?<br><br>1 Karishma<br><br>2 Yuga Aoyama<br><br>3 Denki <br><br>4 Mineta
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!