Answer:
filename = input("Enter file name: ")
movie_container = list()
with open(filename, "r") as movies:
content = movies.readlines()
for movie in content:
holder = movie.split("\t")
movie_container.append((holder[0], holder[1], holder[2], holder[3]))
movie_container = sorted(movie_container, key= lambda movie: movie[0])
for movie in movie_container:
movie_stars = movie[3].split(",")
name_split = [names.split(" ") for names in movie_stars]
movie_stars.clear()
name_split = sorted(name_split, key= lambda names: names[1])
for name in name_split:
full_name = " ".join(name)
print( full_name)
movie_stars.append(full_name)
movie[3] = movie_stars
print(movie_container)
Explanation:
The python code uses the open function to open and read in the input file from the standard user prompt. The title of the movies and the stars are all sorted alphabetically and display at the output.
2. What is the implication of media killings in the Philippines?
Answer:
Throughout the clarification below, the description of the query is mentioned.
Explanation:
In the Philippines, the Implication of media indicates that perhaps the Philippines isn't a safe environment for reporters, and therefore more remains to be improved to change this pattern.But it didn't start underneath Duterte before you could even say that, as well as he didn't order strikes. If he had instructions in which he would criticize, for perhaps a long period presently Ressa had died as one of his other very resolute and influential media commentators.How many different values can a bit have?
16
2
4.
8
Answer:
A bit can only have 2 values
A realtor is studying housing values in the suburbs of Minneapolis and has given you a dataset with the following attributes: crime rate in the neighborhood, proximity to Mississippi river, number of rooms per dwelling, age of unit, distance to Minneapolis and Saint Paul Downtown, distance to shopping malls. The target variable is the cost of the house (with values high and low). Given this scenario, indicate the choice of classifier for each of the following questions and give a brief explanation.
a) If the realtor wants a model that not only performs well but is also easy to interpret, which one would you choose between SVM, Decision Trees and kNN?
b) If you had to choose between RIPPER and Decision Trees, which one would you prefer for a classification problem where there are missing values in the training and test data?
c) If you had to choose between RIPPER and KNN, which one would you prefer if it is known that there are very few houses that have high cost?
Answer:
a. decision trees
b. decision trees
c. rippers
Explanation:
a) I will choose Decision trees because these can be better interpreted compared to these other two KNN and SVM. using Decision tress gives us a better explanation than the other 2 models in this question.
b) In a classification problem with missing values, Decision trees are better off rippers since Rippers avoid the missing values.
c) Ripper are when we know some are high cost houses.
Write a program that asks the user to guess the next roll of a six-sided die. Each guess costs $ 1. If they guess correctly, they get $ 100.00. The player will start out with a $10.00 bank. Each time he (or she) guesses incorrectly you will subtract $1.00 from their bank. Each time they guess correctly, you add $10.00 to their bank. Print the total winnings or losses at the end of the game. You can simulate the toss of the dice using the RandomRange function (Don't forget to Randomize).
Answer in python:
import random
money = 10
winnings = 0
def main():
global winnings
global money
dice_num = random.randrange(1,6)
input_str = "Guess the dice number. You have $"+str(money)+" > "
input_num = input(input_str)
if int(input_num) == dice_num:
money = money + 10
winnings = winnings + 10
else:
money = money - 1
if money < 0:
print("You lose. You won "+str(winnings)+" times. Press enter to try again")
useless_variable = input()
main()
else:
main()
main()
Explanation:
Dr. Smith is teaching IT 102 and wants to determine the highest grade earned on her midterm exam. In Dr. Smith's class, there are 28 students. Midterm exam grades fall in the range of 0 to 100, inclusive of these values. Write a small program that will allow Dr. Smith to enter grades for all of her students, determine the highest grade, and output the highest grade.
Answer:
mysql
Explanation:
try building mysql database
what is the correct process for setting up a recurring project for the same client in qbo accountant?
Answer:
The answer is below
Explanation:
The correct process for setting up a recurring project for the same client in Quickbooks Online Accountant is as follows:
1. Go to Work, then select create a project
2. Select the Repeat button, then set the frequency and duration
3. Formulate the project and save it.
4. Reopen the project
5. And select the Duplicate button for the proportion of times you want it to recur. This includes assigning the interval, day of the recurrence, and end time.
6. Then select Save.
Firstly, invent a separate project, then pick the repeat button on the right of the screen, specify the frequency and duration. Its frequency can indeed be weekly, biweekly, monthly, and so on.
This project's duration must be determined. This step saves the user time when working on a project. Otherwise, the same actions would have to be done again and over, which would be time-consuming and repetitive.New project and click the continue option to start the process of preparing a recurring project for the same client.This second alternative is not the best method to create a recurring project for the same client. Based on the phase, the initiatives can be generated as many times as necessary.Therefore, the answer is "first choice".
Learn more:
brainly.com/question/24356450
Arrange the computers in the order fastest to slowest: Minicomputer, Supercomputer, Personal Computer and Mainframe.
Answer:
supercomputer, mainframe, personal computer, minicomputer
Explanation:
In cell 14, calculate
the profit by
subtracting the
donation from the
streaming revenues.
Answer:
See Explanation
Explanation:
The question is incomplete as the cells that contains donation and streaming revenues are not given
So, I will make the following assumption:
H4 = Donations
G4 = Streaming Revenues
So, the profit will be:
Enter the following formula in cell I4
=(G4 - H4)
To get the actual solution in your case, replace G4 and H4 with the proper cell names
why must a satellite have distinct uplink and downlink frequencies.
Answer:
The reason that a satellite must have a distinct uplink and downlink set of frequencies is because they help avoid any type of interference that may occur. The uplink receives the signal and amplifies it so that it can be transmitted to another frequency (downlink).
Which are technical and visual demands
that need to be considered when
planning a project?
Answer: Resolution or DPI, deliverables, and file types are important technical and visual demands to consider when planning a project.
Explanation: Keep in mind whether or not the project will be published in print or on the Web.
In order to restrict editing to a document, a user will go to Review, , Restrict Editing, and will then select what kinds of editing are allowed.
Answer: drafting
Explanation:
Charging current being returned to the battery is always measured in DC Amps. true or false
Answer:Charging current being returned to the battery is always measured in DC Amps. Electrical energy will always flow from an area of low potential to an area of high potential. ... One volt is the pressure required to force one amp of current through a circuit that has 1 Ohm of resistance.
Explanation:
As the network engineer, you are asked to design a plan for an IP subnet that calls for 25 subnets. The largest subnet needs a minimum of 750 hosts. Management requires that a single mask must be used throughout the Class B network. Which of the following lists a private IP network and mask that would meet the requirements?
a. 172.16.0.0 / 255.255.192.0
b. 172.16.0.0 / 255.255.224.0
c. 172.16.0.0 / 255.255.248.0
d. 172.16.0.0 / 255.255.254.0
Answer:
c. 172.16.0.0 / 255.255.248.0
Explanation:
The address will be 172.16.0.0 while the netmask will be 255.255.248.0.
Thus, option C is correct.
Do any of these algorithms (Random Allocation, Round-Robin, Weighted Round-Robin, Round-Robin DNS Load Balancing, and Least Connections) compromise security?
Answer:
yes and
Explanation:
why do you need to know about a buildings security are you going to rob it ???
Write a function called 'game_of_eights()' that accepts a list of numbers as an argument and then returns 'True' if two consecutive eights are found in the list. For example: [2,3,8,8,9] -> True. The main() function will accept a list of numbers separated by commas from the user and send it to the game_of_eights() function. Within the game_of_eights() function, you will provide logic such that: the function returns True if consecutive eights (8) are found in the list; returns False otherwise. the function can handle the edge case where the last element of the list is an 8 without crashing. the function prints out an error message saying 'Error. Please enter only integers.' if the list is found to contain any non-numeric characters. Note that it only prints the error message in such cases, not 'True' or 'False'. Examples: Enter elements of list separated by commas: 2,3,8,8,5 True Enter elements of list separated by commas: 3,4,5,8 False Enter elements of list separated by commas: 2,3,5,8,8,u Error. Please enter only integers.
Answer:
In Python:
def main():
n = int(input("List items: "))
mylist = []
for i in range(n):
listitem = input(", ")
if listitem.isdecimal() == True:
mylist.append(int(listitem))
else:
mylist.append(listitem)
print(game_of_eights(mylist))
def game_of_eights(mylist):
retVal = "False"
intOnly = True
for i in range(len(mylist)):
if isinstance(mylist[i],int) == False:
intOnly=False
retVal = "Please, enter only integers"
if(intOnly == True):
for i in range(len(mylist)-1):
if mylist[i] == 8 and mylist[i+1]==8:
retVal = "True"
break
return retVal
if __name__ == "__main__":
main()
Explanation:
The main begins here
def main():
This gets the number of list items from the user
n = int(input("List items: "))
This declares an empty list
mylist = []
This iterates through the number of list items
for i in range(n):
This gets input for each list item, separated by comma
listitem = input(", ")
Checks for string and integer input before inserting item into the list
if listitem.isdecimal() == True:
mylist.append(int(listitem))
else:
mylist.append(listitem)
This calls the game_of_eights function
print(game_of_eights(mylist))
The game_of_eights function begins here
def game_of_eights(mylist):
This initializes the return value to false
retVal = "False"
This initializes a boolean variable to true
intOnly = True
This following iteration checks if the list contains integers only
for i in range(len(mylist)):
If no, the boolean variable is set to false and the return value is set to "integer only"
if isinstance(mylist[i],int) == False:
intOnly=False
retVal = "Please, enter only integers"
This is executed if the integer contains only integers
if(intOnly == True):
Iterate through the list
for i in range(len(mylist)-1):
If consecutive 8's is found, update the return variable to True
if mylist[i] == 8 and mylist[i+1]==8:
retVal = "True"
break
This returns either True, False or Integer only
return retVal
This calls the main method
if __name__ == "__main__":
main()
Ask the user to input their grade percentage (e.g. the use will enter 98 if they had an overall grade of 98% in their course) for their Accounting, Marketing, Economics and MIS courses. Assume each course is worth 3 credit hours. Once you have all of their grades output what letter grade they earned for each course (e.g. Your letter grade for {Accounting/Marketing/whichever one you are outputting} is {A/B/C/D/F}). After you have output all of their letter grades, output their overall GPA for the semester using the formula:
Letter Grade Point Value for Grade
A 4.00
B 3.00
C 2.00
D 1.00
F 0.00
Example Student Transcript
Course Credit Hours Grade Grade Points
Biology 5 A 20
Biology Lab 1 B 3
English 5 C 10
Mathematics 5 F 033
16 Total Credits Attempted 33 Total Grade Points
Total Points Earned/Total Credits Attempted = Grade Point Average
33 Points Earned/16 Credits Attempted = 2.06 GPA
For more details on how to calculate your GPA, go to http://academicanswers.waldenu.edu/faq/73219 e
GPA - Convert MIS grade to letter grade using a conditional statement
GPA - Convert Accounting letter grade to points earned (can be done in same conditional as letter grade
GPA - Convert Marketing letter grade to points earned (can be done in same conditional as letter grade)
GPA-Convert Economics letter grade to points earned (can be done in same conditional as letter grade)
GPA-Convert MIS letter grade to points earned (can be done in same conditional as letter grade) GPA - Calculate the GPA
GPA-Output the letter grade for each course
GPA-Output the overall GPA for the semester
Answer:
In Python
def getpointValue(subject):
if subject >= 75: point = 4; grade = 'A'
elif subject >= 60: point = 3; grade ='B'
elif point >= 50: point = 2; grade = 'C'
elif point >= 40: point = 1; grade = 'D'
else: point = 0; grade = 'F'
return point,grade
subjects= ["Accounting","Marketing","Economics","MIS"]
acct = int(input(subjects[0]+": "))
mkt = int(input(subjects[1]+": "))
eco = int(input(subjects[2]+": "))
mis = int(input(subjects[3]+": "))
acctgrade = getpointValue(acct)
print(subjects[0]+" Grade: "+str(acctgrade[1]))
mktgrade = getpointValue(mkt)
print(subjects[1]+" Grade: "+str(mktgrade[1]))
ecograde = getpointValue(eco)
print(subjects[2]+" Grade: "+str(ecograde[1]))
misgrade = getpointValue(mis)
print(subjects[3]+" Grade: "+str(misgrade[1]))
totalpoint = (acctgrade[0] + mktgrade[0] + ecograde[0] + misgrade[0]) * 3
gpa = totalpoint/12
print("GPA: "+str(gpa))
Explanation:
The solution I provided uses a function to return the letter grade and the point of each subject
I've added the explanation as an attachment where I used comment to explain difficult lines
write a BASIC program to find the product of any two numbers
Answer:
Print 4 + 4
Explanation:
If you're writing this in the programming language called BASIC, this is how you would add any two numbers.
A service specialist from your company calls you from a customer's site. He is attempting to install an upgrade to the software, but it will not install; instead, it he receives messages stating that he cannot install the program until all non-core services are stopped. You cannot remotely access the machine, but the representative tells you that there are only four processes running, and their PID numbers are 1, 10, 100, and 1000. With no further information available, which command would you recommend the representative run?
Answer:
kill 1000
Explanation:
An expression that returns a value is known as a
Answer:
In computer programming, a return statement causes execution to leave the current subroutine and resume at the point in the code immediately after the instruction which called the subroutine, known as its return address. The return address is saved by the calling routine, today usually on the process's call stack or in a register. Return statements in many languages allow a function to specify a return value to be passed back to the code that called the function.
An expression that returns a value is known as a function. Check more about function below.
What is a function?A function is often seen as a kind of expression or rule, or law that often tells more about a relationship.
Conclusively, a function is known to often returns a value back to the instruction that is known also to be the function. This is regarded as the differences that exist between a method and a function.
Learn more about function from
https://brainly.com/question/20476366
Which story element refers to the way the story unfolds?
A.
premise
B.
back story
C.
synopsis
D.
plot
Answer:
D. Plot
Explanation:
The plot is how the story develops, unfolds and move through time.
In ……………cell reference, the reference of a cell does not change.
Answer:
In absolute cell reference, the reference of a cell does not change.
For this program you will build a simple dice game called Pig. In this version of Pig, two players alternate turns. Players each begin the game with a score of 0. During a turn a player will roll a six-sided die one or more times, summing up the resulting rolls. At the end of the player's turn the sum for that turn is added to the player's total game score If at any time a player rolls a 1, the player's turn immediately ends and he/she earns O points for that turn (i.e. nothing is added to the player's total game score). This is called "pig". After every roll that isn't a 1, the player may choose to either end the turn, adding the sum from the current turn to his/her total game score, or roll again in an attempt to increase the sum. The first player to 50 points wins the game
Details
Open a text editor and create a new file called pig.py. In the file
Write a function called print_scores that has four parameters - these hold, in this order, the name of the first player (a string), his/her score (an int), the second player's name (a string), and score (an int).
The function will
Print the following message, using the current parameter values for the player names and scores (NOT necessarily Ziggy, 18, Elmer, and 23) -SCORES Ziggy:18 Elmer 23--
Print an empty line before this line
There is a single tab between SCORES and the name of player 1 .
There is a single tab between player 1's score and player 2's name .
Every other gap is a single space
Answer:
In Python:
import random
p1name = input("Player 1: "); p2name = input("Player 2: ")
p1score = 0; p2score = 0
playerTurn = 1
print(p1name+" starts the game")
roll = True
while(roll):
if playerTurn == 1:
p1 = random.randint(1,6)
print(p1name+"'s roll: "+str(p1))
if p1 == 1:
playerTurn = 2
roll = True
else:
p1score+=p1
another = input("Another Roll (y/n): ")
if another == "y" or another == "Y":
roll = True
else:
playerTurn = 2
roll = True
else:
p2 = random.randint(1,6)
print(p2name+"'s roll: "+str(p2))
if p2 == 1:
playerTurn = 1
roll = True
else:
p2score+=p2
another = input("Another Roll (y/n): ")
if another == "y" or another == "Y":
roll = True
else:
playerTurn = 1
roll = True
if p1score >= 50 or p2score >= 50:
roll = False
print(p1name+":\t"+str(p1score)+"\t"+p2name+":\t"+str(p2score))
Explanation:
Note that the dice rolling is simulated using random number whose interval is between 1 and 6
This imports the random module
import random
This line gets the name of both players
p1name = input("Player 1: "); p2name = input("Player 2: ")
This line initializes the scores of both players to 0
p1score = 0; p2score = 0
This sets the first play to player 1
playerTurn = 1
This prints the name of player 1 to begin the game
print(p1name+" starts the game")
This boolean variable roll is set to True.
roll = True
Until roll is updated to False, the following while loop will be repeated
while(roll):
If player turn is 1
if playerTurn == 1:
This rolls the dice
p1 = random.randint(1,6)
This prints the outcome of the roll
print(p1name+"'s roll: "+str(p1))
If the outcome is 1, the turn is passed to player 2
if p1 == 1:
playerTurn = 2
roll = True
If otherwise
else:
Player 1 score is updated
p1score+=p1
This asks if player 1 will take another turn
another = input("Another Roll (y/n): ")
If yes, the player takes a turn. The turn is passed to player 2, if otherwise
if another == "y" or another == "Y":
roll = True
else:
playerTurn = 2
roll = True
If player turn is 2
else:
This rolls the dice
p2 = random.randint(1,6)
This prints the outcome of the roll
print(p2name+"'s roll: "+str(p2))
If the outcome is 1, the turn is passed to player 1
if p2 == 1:
playerTurn = 1
roll = True
If otherwise
else:
Player 2 score is updated
p2score+=p2
This asks if player 2 will take another turn
another = input("Another Roll (y/n): ")
If yes, the player takes a turn. The turn is passed to player 1, if otherwise
if another == "y" or another == "Y":
roll = True
else:
playerTurn = 1
roll = True
If either of both players has scored 50 or above
if p1score >= 50 or p2score >= 50:
roll is updated to False i.e. the loop ends
roll = False
This prints the name and scores of each player
print(p1name+":\t"+str(p1score)+"\t"+p2name+":\t"+str(p2score))
Write a C++ program to calculate the course score of CSC 126. 1. A student can enter scores of 3 quizzes, 2 exams, and a final exam. The professor usually keeps 1 digit after the point in each score but the overall course score has no decimal places. 2. The lowest quiz score will not be calculated in the quiz average. 3. The weight of each score is: quiz 20%, exams 30%, and the final 50%. 4. The program will return the weighted average score and a letter grade to the student. 5. A: 91 - 100, B: 81 - 90, C: 70 - 80, F: < 70.
Answer:
In C++:
#include <iostream>
using namespace std;
int main(){
double quiz1, quiz2, quiz3, exam1, exam2, finalexam,quiz;
cout<<"Quiz 1: "; cin>>quiz1;
cout<<"Quiz 2: "; cin>>quiz2;
cout<<"Quiz 3: "; cin>>quiz3;
cout<<"Exam 1: "; cin>>exam1;
cout<<"Exam 2: "; cin>>exam2;
cout<<"Final Exam: "; cin>>finalexam;
if(quiz1<=quiz2 && quiz1 <= quiz3){ quiz=(quiz2+quiz3)/2; }
else if(quiz2<=quiz1 && quiz2 <= quiz3){ quiz=(quiz1+quiz3)/2; }
else{ quiz=(quiz1+quiz2)/2; }
int weight = 0.20 * quiz + 0.30 * ((exam1 + exam2)/2) + 0.50 * finalexam;
cout<<"Average Weight: "<<weight<<endl;
if(weight>=91 && weight<=100){ cout<<"Letter Grade: A"; }
else if(weight>=81 && weight<=90){ cout<<"Letter Grade: B"; }
else if(weight>=70 && weight<=80){ cout<<"Letter Grade: C"; }
else{ cout<<"Letter Grade: F"; }
return 0;
}
Explanation:
See attachment for complete program where comments were used to explain difficult lines
We can easily improve the formula by approximating the area under the function f(x) by two equally-spaced trapezoids. Derive a formula for this approximation and implement it in a function trapezint2( f,a,b ).
Answer:
Explanation:
[tex]\text{This is a math function that is integrated using a trapezoidal rule } \\ \\[/tex]
[tex]\text{import math}[/tex]
def [tex]\text{trapezint2(f,a,b):}[/tex]
[tex]\text{midPoint=(a+b)/2}[/tex]
[tex]\text{return .5*((midPoint-a)*(f(a)+f(midPoint))+(b-midPoint)*(f(b)+f(midPoint)))}[/tex]
[tex]\text{trapezint2(math.sin,0,.5*math.pi)}[/tex]
[tex]0.9480594489685199[/tex]
[tex]trapezint2(abs,-1,1)[/tex]
[tex]1.0[/tex]
In this exercise we have to use the knowledge of computational language in python to write the code.
the code can be found in the attachment.
In this way we have that the code in python can be written as:
h = (b-a)/float(n)
s = 0.5*(f(a) + f(b))
for i in range(1,n,1):
s = s + f(a + i*h)
return h*s
from math import exp # or from math import *
def g(t):
return exp(-t**4)
a = -2; b = 2
n = 1000
result = Trapezoidal(g, a, b, n)
print result
See more about python at brainly.com/question/26104476
Look at the following assignment statements:
word1 = "rain"
word2 = "bow"
What is the correct way to concatenate the strings?
1 newWord = word1 == word2
2 newWord = word1 + word2
3 newWord = word1 * word2
4 newWord = word1 - word2
Answer: number 2 is the correct way to do it
Explanation:
Answer:
2 newWord = word1 + word2
Explanation:
How many thermal performance control modes are there in Alienware Area 51m to support different user scenarios?
Answer:
3
Explanation:
The Dell Alienware Personal Computers refers to a range of PC's which are known for their strength, durability and most commonly their graphical performance. Th ecomputwrs are built to handle very high and intensive graphic demanding programs including gaming. The Alienware area 51m is a laptop which has been loaded with the capability and performance of a high graphic demanding desktop computers boasting massive memory size and greater graphic for better game play and high graphic demanding programs.
The laptop features an improved thermal and performance capability to handle the effect of different graphic demanding programs. Therfore, the laptop has 3 different thermal a d performance system modes which altenrtes depending on graphic demands in other to handle intensive demands.
It should be noted that the number of thermal performance mode is 5.
From the complete information, it should be noted that there are five thermal performance control modes are there in Alienware Area 51m to support different user scenarios.
The modes are:
Full speed mode.Performance mode.Balanced mode.Quiet mode.Cool mode.In conclusion, the correct option is 5
Learn more about modes on:
https://brainly.com/question/25604446
Select the correct answer.
David gets a new job as a manager with a multinational company. On the first day, he realizes that his team consists of several members from diverse cultural backgrounds. What strategies might David use to promote an appreciation of diversity in his team?
A.
Promote inclusion, where he can encourage members to contribute in discussions.
B.
Create task groups with members of the same culture working together.
C.
Allow members time to adjust to the primary culture of the organization.
D.
Provide training on the primary culture to minority groups only if there are complaints against them.
Answer:
A.
Explanation:
If we were to go with B, then it would exclude others from different cultures, doing what he is trying to.
If we went with C, then they wouldn't get along very well, because no one likes to be forced into a different religion.
If we went with D, he wants an appreciation, so training some people to change religions if there are complaints, is not going to cut it. Therefore, we have A. Which I do not need to explain.
Complete the function favoriteFlower(). Note that the program will not run as is because the function is incomplete. The purpose of the function is to determine if the given flower is in the top three of my favorite flowers. The starter file defines a list of favorite flowers that is ordered most favorite to least favorite. Please pass the flower name and the flower list as arguments in the function. The expected output is:
Answer:
What Language? Once you respond with a comment, I will be happy to write the code for you. I write code 24/7 (Because I have nothing better to do), so I will wait for you to comment. Also is there any pre-existing code?
Explanation:
Which feature in Access is used to control data entry into database tables to help ensure consistency and reduce errors?
O subroutines
O search
O forms
O queries
The answer is: Forms
To control data entry into database tables to help ensure consistency and reduce errors will be known as forms in data entry.
What are forms in data entry?A form is a panel or panel in a database that has many fields or regions for data input.
To control data entry into database tables to help ensure consistency and reduce errors will be forms.
Then the correct option is C.
More about the forms in data entry link is given below.
https://brainly.com/question/10268767
#SPJ2
PLEASE HELP How have phones made us spoiled? How have phones made us unhappy?