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
How do you tack pictures for this app
olga2289 [7]
There is a paper clip on the bottom left on your screen. When answering a question click it to apply a picture. Have a wonderful day.

(Take*)
3 0
3 years ago
Most case fans have standard _______________ connectors that are easy to plug in but can be forced to be connected the wrong way
SIZIF [17.4K]

Answer:

Molex

Hope this Helps!

4 0
3 years ago
Implementations <br> in c++ programming when finding lcm and gcd in c++​
vazorg [7]

Answer:

#include<iostream>

using namespace std;

int lcm(int m, int n) {

  int a;

  a = (m > n) ? m: n;

  while (true) {

     if (a % m == 0 && a % n == 0)

        return a;

        ++a;

  }

}

int gcd(int m, int n) {

  int r = 0, a, b;

  a = (m > n) ? m : n;

  b = (m < n) ? m : n;

  r = b;

  while (a % b != 0) {

     r = a % b;

     a = b;

     b = r;

  }

  return r;

}

int main(int argc, char **argv) {

  cout << "Enter the two numbers: ";

  int m, n;

  cin >> m >> n;

  cout << "The LCM of two numbers is: " << lcm(m, n) << endl;

  cout << "The GCD of two numbers is: " << gcd(m, n) << endl;  

  return 0;

}

Explanation:

7 0
3 years ago
What country is associated with the tor relay using the ip address 104. 244. 74. 97?.
Lelu [443]

Answer:

104.28.63.45 is an IP address located in Santos, Sao Paulo.

Explanation:

3 0
2 years ago
) What does sampling mean?
lubasha [3.4K]
In terms of music taking one song and incorporating it into your own song
6 0
3 years ago
Other questions:
  • Among the web programming languages, css is used to define _____ of the web page
    5·1 answer
  • Which question best addresses the issue of risk with a new job?
    7·2 answers
  • Mr. Mathis asked his students to add a comment to a cell the students recorded the steps they followed in a chart. Which student
    12·2 answers
  • A matrix representation stores matrices such that the offset address of the element in row i and column j can be calculated by c
    12·1 answer
  • What information medium is used to access information from the Internet in the form of HTML pages?
    12·1 answer
  • You will be given a string, containing both uppercase and lowercase alphabets(numbers are not allowed).
    14·1 answer
  • Can Word Processing (WP) programs be used for DTP? Explain your answer
    7·1 answer
  • _________ is the start up sequence a computer conducts.
    9·1 answer
  • What goals do you set for yourself while studying?
    9·2 answers
  • Plain text and ASCII text are the same thing. true or false
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!