Answer:
Here is the Python program:
import random #to generate random numbers
def generateRandNo(): #function to generate random number
randNo = random.randint(1,100) #generates random number in range from 1 to 100
return randNo #returns the generated random number
def userInput(message = "Guess the number "): #to gets integer input from user and return the input number
userGuess = int(input(message)) #store the int type input from user in userGuess variable
return userGuess #returns the user input number
def compareNumbers(userGuess,randNo): #compares the user input with actual randomly generated number
if userGuess > randNo: # if user input is greater than actual number
return "The number is too high"
elif userGuess < randNo: #if user input is less than actual number
return "The number is too low"
else: #if user guess is correct
return "Correct"
def main(): #main method
correct = False #sets correct to False
begin = True #sets start game i.e. begin to True
while correct or begin: #while loop keeps repeating as long as user guess is correct or user wants to start game again
guessCount = 0 #counts number of trials user takes to guess the correct number
randNo = generateRandNo() #generates a random number using generateRandNo
userGuess = userInput() #gets input number from user using userInput method
guessCount+=1 #increments at each guess made by user
message = compareNumbers(userGuess,randNo) #compares user guess input number with actual number
while message != "Correct" : # while message is not equal to Correct
print(message) #prints to guess the number
userGuess = userInput("Try again: ") #keeps asking user to try again and enter a number
guessCount = guessCount + 1 #increments guessCount by 1 at each guess made by user
message = compareNumbers(userGuess,randNo) #compares user input with actual number
print()
print(message,"It took you ",guessCount," attempts to answer\n") #prints how much trials user took to guess correct number
choice = input("Do you wish to continue? (Enter yes or no) ") #asks user if user wants to start over
if choice == 'no': # if user enters no
exit(1) #exits the program
else: #if user enters yes starts the game again
correct = True #sets correct guess to True
main() #calls main method to start the guess game
Explanation:
The program is well explained in the comments attached with each line of the code. Suppose the randomly generated number (actual number) is 50 and user input is 24 then message The number is too low is displayed and if user guess input is 80 then The number is too high is displayed. If the user guesses the correct number i.e. 50 3rd time then the message displayed is:
It took you 3 attempts to answer.
The the user is asked to continue as:
Do you wish to continue? (Enter yes or no)
If user enters no the program exits if yes then user is asked to Guess the number again.
The screenshot of output is attached.
Termux...what is it used for?
got a little bit of skill
Answer:
Termux is a free and open source terminal emulator for Android which allows for running a Linux environment on an Android device. ... Termux installs a minimal base system automatically, and additional packages are available using a package manager.
Which of the following statements converts a String object named subtotalString to a double variable named subtotal?a.double subtotal = Double.toString(subtotalString);b.double subtotal = subtotalString.parseDouble;c.double subtotal = Double.parseDouble(subtotalString);d.double subtotal = (double) subtotalString
Answer:
double subtotal = Double.parseDouble(subtotalString);
Explanation:
Required
Determine which method converts string object to double variable
From the question;
The string object is: subtotalString
The double variable is: subtotal
From the given options (a) to (d), the option that answers the question is:
double subtotal = Double.parseDouble(subtotalString);
And it follows the syntax:
[datatype] [variable-name] = [Data-type].parse[Datatype]([string-variable])
1. Human errors are often classified into slips and mistakes.
In light of this, human error is defined as a mistake committed by a person who themselves made a mistake.
What is the process of human error slips and mistakes?In light of this, human error is defined as a mistake committed by a person who themselves made a mistake. rather than being misled or swayed by other aspects of the design. Another name for it is operator error. Although it is frequently mentioned in context, human error is a crucial notion in ergonomics. Slips and lapses (skill-based errors), mistakes, and errors are the three categories of human error. Even the most skilled and experienced person can make these kinds of mistakes. Slips and lapses happen when performing routine jobs that don't need much conscious thought, like driving a car.To learn more about human error slips refer to:
https://brainly.com/question/28624534
#SPJ1
You are building a predictive solution based on web server log data. The data is collected in a comma-separated values (CSV) format that always includes the following fields: date: string time: string client_ip: string server_ip: string url_stem: string url_query: string client_bytes: integer server_bytes: integer You want to load the data into a DataFrame for analysis. You must load the data in the correct format while minimizing the processing overhead on the Spark cluster. What should you do? Load the data as lines of text into an RDD, then split the text based on a comma-delimiter and load the RDD into a DataFrame. Define a schema for the data, then read the data from the CSV file into a DataFrame using the schema. Read the data from the CSV file into a DataFrame, infering the schema. Convert the data to tab-delimited format, then read the data from the text file into a DataFrame, infering the schema.
Answer:
see explaination
Explanation:
The data is collected in a comma-separated values (CSV) format that always includes the following fields:
? date: string
? time: string
? client_ip: string
? server_ip: string
? url_stem: string
? url_query: string
? client_bytes: integer
? server_bytes: integer
What should you do?
a. Load the data as lines of text into an RDD, then split the text based on a comma-delimiter and load the RDD into DataFrame.
# import the module csv
import csv
import pandas as pd
# open the csv file
with open(r"C:\Users\uname\Downloads\abc.csv") as csv_file:
# read the csv file
csv_reader = csv.reader(csv_file, delimiter=',')
# now we can use this csv files into the pandas
df = pd.DataFrame([csv_reader], index=None)
df.head()
b. Define a schema for the data, then read the data from the CSV file into a DataFrame using the schema.
from pyspark.sql.types import *
from pyspark.sql import SparkSession
newschema = StructType([
StructField("date", DateType(),true),
StructField("time", DateType(),true),
StructField("client_ip", StringType(),true),
StructField("server_ip", StringType(),true),
StructField("url_stem", StringType(),true),
StructField("url_query", StringType(),true),
StructField("client_bytes", IntegerType(),true),
StructField("server_bytes", IntegerType(),true])
c. Read the data from the CSV file into a DataFrame, infering the schema.
abc_DF = spark.read.load('C:\Users\uname\Downloads\new_abc.csv', format="csv", header="true", sep=' ', schema=newSchema)
d. Convert the data to tab-delimited format, then read the data from the text file into a DataFrame, infering the schema.
Import pandas as pd
Df2 = pd.read_csv(‘new_abc.csv’,delimiter="\t")
print('Contents of Dataframe : ')
print(Df2)
Zeke is working on a project for his economics class. He needs to create a visual that compares the prices of coffee at several local coffee shops. Which of the charts below would be most appropriate for this task?
Line graph
Column chart
Pie chart
Scatter chart
Opting for a column chart is the best way to compare prices of coffee at various local coffee shops.
Why is a column chart the best option?By representing data in vertical columns, this type of chart corresponds with each column's height showing the value depicted; facilitating an efficient comparison between different categories.
In our case, diverse branches of local coffee shops serve as various categories and their coffee prices serve as values. Depicting trends over time suggested usage of a line graph. Pie charts exhibit percentages or proportions ideally whereas scatter charts demonstrate the relationship between two variables.
Read more about column chart here:
https://brainly.com/question/29904972
#SPJ1
Print a message telling a user to press the letterToQuit key numPresses times to quit. End with newline. Ex: If letterToQuit = 'q' and numPresses = 2, print:
You can find in the photo. Good luck!
More than one component in a particular automotive electric circuit is not working. Technician A starts testing the circuit at the power source. Technician B starts testing the circuit at its load. Who is right?
Hi there! Hopefully this helps!
--------------------------------------------------------------------------------------------------
The answer is A, testing the circuit at the power source.
Date:
Difference between Chemical Equivalent and Electroche-
mical equivalent.
Answer:
chemical equivalent of an element is the value obtained by dividing the atomic weigh of the given element by valency
Su now wants to modify the text box that contains her numbered list. She accesses the Format Shape pane. In what ways can Su modify the text box using the pane? Check all that apply.
She can rotate the text box.
She can add color to the text box.
She can add a shape to the text box.
She can add a border to the text box.
She can insert a picture in the text box.
Answer:
She can add color to the text box.
She can add a border to the text box.
Explanation:
Answer:
B. She can add color to the text box.
D. She can add a border to the text box
Explanation:
hope this helps :)
The epa requires spray guns used in the automotive refinishing process to have transfer efficiency of at least
The epa requires spray guns used in the automotive refinishing process to have transfer efficiency of at least 65 percent transfer efficiency.
What is the transfer efficiency
EPA lacks transfer efficiency requirement for auto refinishing spray guns. The EPA regulates auto refinishing emissions and impact with rules. NESHAP regulates paint stripping and coating operations for air pollutants.
This rule limits VOCs and HAPs emissions in automotive refinishing. When it comes to reducing overspray and minimizing wasted paint or coating material, transfer efficiency is crucial. "More efficiency, less waste with higher transfer rate."
Learn more about transfer efficiency from
https://brainly.com/question/29355652
#SPJ1
5. What are Excel cell references by default?
Relative references
Absolute references
Mixed references
Cell references must be assigned
Answer: relative references
Explanation:
By default, all cell references are RELATIVE REFERENCES. When copied across multiple cells, they change based on the relative position of rows and columns. For example, if you copy the formula =A1+B1 from row 1 to row 2, the formula will become =A2+B2.
(ANSWER ASAP!! GIVING BRAINLIEST IF CORRECT :))
Before she applies for an internship with a local engineering company, what type of letter might Zaynab ask one of her teachers to write for her?
A: resignation letter
B: complaint letter
C: thank-you letter
D: recommendation letter
Answer:
D
Explanation:
She would want a teacher to write a recommendation letter. A recommendation letter vouches for the student and explains why the student would be a good fit for the job.
Answer:
Recommendation letter
Explanation:
A recommendation letter vouches for the student and explains why the student would be a good fit for the job.
If you wanted to use the numeric key pad to multiply 8 and 5 and then divide by 2, you would type
1. 8/5*2
2. 5/2/8
3. 8*5*2
4. 8*5/2
Answer:
Option 4 would be your best answer
Explanation:
The * means multiply
And the / means Divide
Hope this helps :D
Can anyone do this I can't under stand
Answer:
I think u had to take notes in class
Explanation:
u have yo write 4 strings
5.19 LAB: Countdown until matching digits
PYTHON: Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical.
Using the knowledge of computational language in python it is possible to write a code that write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical.
Writting the code:n = int(input())
if 20 <= n <= 98:
while n % 11 != 0:
print(n)
n -= 1
print(n)
else:
print("Input must be 20-98")
See more about python at brainly.com/question/18502436
#SPJ1
whats 7,650÷ ----- = 7.65
Answer:
7,650 ÷ 1000 = 7.65
Explanation:
We need to solve the below expression :
7,650 ÷ ----- = 7.65
Let the blank is x.
7,650 ÷ x = 7.65
\(\dfrac{7650}{x}=7.65\)
Multiplying both sides by 7.65 and cross multiplying :
\(\dfrac{7650}{7.65}=x\\\\\dfrac{7650\times 100}{765}=x\\\\x=1000\)
Hence, 7,650 ÷ 1000 = 7.65
Study the sentence below. Highlighting a word, phrase, or a sentence is used to emphasize or CALL ATTENTION to the text Which word is highlighted?
Answer: Emphasize
Explanation:
Answer: Emphasize
Explanation: gl hope this helps
Which of the following is a positional argument?
a) ABOVE
b) MIN
c) AVERAGE
d) MAX
Which of the following if statements uses a Boolean condition to test: "If you are 18 or older, you can vote"? (3 points)
if(age <= 18):
if(age >= 18):
if(age == 18):
if(age != 18):
The correct if statement that uses a Boolean condition to test the statement "If you are 18 or older, you can vote" is: if(age >= 18):
In the given statement, the condition is that a person should be 18 years or older in order to vote.
The comparison operator used here is the greater than or equal to (>=) operator, which checks if the value of the variable "age" is greater than or equal to 18.
This condition will evaluate to true if the person's age is 18 or any value greater than 18, indicating that they are eligible to vote.
Let's analyze the other if statements:
1)if(age <= 18):This statement checks if the value of the variable "age" is less than or equal to 18.
However, this condition would evaluate to true for ages less than or equal to 18, which implies that a person who is 18 years old or younger would be allowed to vote, which is not in line with the given statement.
2)if(age == 18):This statement checks if the value of the variable "age" is equal to 18. However, the given statement allows individuals who are older than 18 to vote.
Therefore, this condition would evaluate to false for ages greater than 18, which is not correct.
3)if(age != 18):This statement checks if the value of the variable "age" is not equal to 18.
While this condition would evaluate to true for ages other than 18, it does not specifically cater to the requirement of being 18 or older to vote.
For more questions on Boolean condition
https://brainly.com/question/26041371
#SPJ8
To set up scenarios,then set up a list, then set up the reference cell. to set up the cells that display the output results from the scenario. what do you use
To set up the cells that display the output results from the scenario, you will use data table , then Vlookup and Choose.
What do you use to set up the cells that display the output results from the scenario?In setting up the cells that display the output results from the scenario, then the first thing needed is data table which is necessary when setting up a list.
Followed by the , Vlookup which is used in the setting up of the reference cell and lastly Choose.
Learn more about reference cell on:
https://brainly.com/question/21644802
#SPJ1
[80 points] Fill in the missing word.
class CatLady(Exception):
pass
answer = input("How many cats do you have? ")
cats = int(answer)
try:
if cats > 5:
raise CatLady
else:
print("You have", cats, "cats")
_________ CatLady:
print("You have a lot of cats!")
Answer:
except
you can use github copilot for this question
Answer: except
Explanation: i took the test
What formatting changes do spreadsheet applications permit in the rows and columns of a spreadsheet?
Row and Column Formatting Options
Formatting rows and columns is similar to cell formatting. In an OpenOffice Calc spreadsheet, you can format data entered into rows and columns with the help of the Rows and Columns options. You can insert rows and columns into, or delete rows and columns from, a spreadsheet. Use the Insert or Delete rows and columns option on the Insert tab. Alternatively, select the row or column where you want new rows or columns to appear, right-click, and select Insert Only Row or Only Column options.
You can hide or show rows and columns in a spreadsheet. Use the Hide or Show option on the Format tab. For example, to hide a row, first select the row, then choose the Insert tab, then select the Row option, and then select Hide. Alternatively, you can select the row or columns, right-click, and select the Hide or Show option.
You can adjust the height of rows and width of columns. Select Row and then select the Height option on the Format tab. Similarly, select Column, then select the Width option on the Format tab. Alternatively, you can hold the mouse on the row and column divider, and drag the double arrow to the position. You can also use the AutoFit option on the Table tab to resize rows and columns.
Formatting rows and columns in a spreadsheet is similar to cell formatting. In OpenOffice Calc, users can insert or delete rows and columns, hide or show them, and adjust the height and width of the rows and columns.
What is spreadsheet?A spreadsheet is an electronic document that stores data in a tabular format and is used to perform calculations and analysis. It is a type of software program designed to assist with data entry, calculations, and other analysis tasks. Spreadsheets often contain formulas and functions that allow users to quickly and accurately calculate values based on the data they enter. Spreadsheets also provide users with the ability to present data in an organized and visually appealing way. Spreadsheets are an essential tool for businesses, schools, and other organizations to help them make decisions, track progress, and manage resources.
Users can access these options from the Insert, Format, and Table tabs. Alternatively, they can select the row or column they want to format, right-click, and select the relevant option. Additionally, users can hold the mouse on the row or column divider and drag the double arrow to the desired position. The AutoFit option on the Table tab can also be used to resize rows and columns.
To learn more about spreadsheet
https://brainly.com/question/30039670
#SPJ1
25 Points !! HELP ASAP . DUE TOMORROW MORNING .
Imagine you are scrolling through your social media and you see these two links, which one would you click on? Why? Explain answer 2-3 sentences long .
Answer:
The Associated Press
Explanation:
Out of the two options presented, The Associated Press caught my attention more due to its compelling content. The content displayed is visually appealing and likely to pique one's curiosity, motivating one to seek further information.
Design a pseudo code that determines if a given number is even or odd number
The pseudocode determines if a given number is even or odd by checking if it's divisible by 2 and then prints the respective result.
Here's a simple pseudocode to determine if a given number is even or odd:
Input: number
Output: "Even" if the number is even, "Odd" if the number is odd
if number is divisible by 2 with no remainder then
Print "Even"
else
Print "Odd"
end if
This pseudocode checks whether the given number is divisible by 2. If it is, it prints "Even" since even numbers are divisible by 2. Otherwise, it prints "Odd" since odd numbers are not divisible by 2.
Learn more about pseudocode here:
https://brainly.com/question/17102236
#SPJ7
why was the keyboard invented, write a paragraph and you can get a crown and 50 points
Answer:
The keyboard was invented for the alphabet and numbers so people can talk to others and work on essays, and have a way to communicate to human beings and for stuff like i'm doing right now, writing paragraphs for stuff like this and for school, really the keyboard was invented for anything, you can use it for anything in the whole world.
Explanation:
Hope this helps!!
. Write a program to calculate the square of 20 by using a loop
that adds 20 to the accumulator 20 times.
The program to calculate the square of 20 by using a loop
that adds 20 to the accumulator 20 times is given:
The Programaccumulator = 0
for _ in range(20):
accumulator += 20
square_of_20 = accumulator
print(square_of_20)
Algorithm:
Initialize an accumulator variable to 0.
Start a loop that iterates 20 times.
Inside the loop, add 20 to the accumulator.
After the loop, the accumulator will hold the square of 20.
Output the value of the accumulator (square of 20).
Read more about algorithm here:
https://brainly.com/question/29674035
#SPJ1
sari
Questions
Question 3 of 8
A-Z
» Listen
Companies are chosen for collaboration based on quality, reputation, and
price.
False
True
Answer:
aaaaaaaaaaaaaaaaaaaaaaaaaa
Explanation:
Consider any tasks performed in real life, for example, driving a taxi. The task you pick involves many functions. Driving a taxi involves picking up customers, and quickly and safely transporting them to their destination. Go through the components of the AI cycle to automate the problem you choose. List the useful precepts available. Describe how you will represent your knowledge. Based on that, describe how you will use reasoning to make and execute a plan expected to achieve a goal or obtain maximum utility. (this is for artificial intelligence, but they did not have that option)
The ________ attribute of the anchor tag can cause the new web page to open in its own browser window.
Select one:
a. target
b. window Incorrect
c. id
d. href
Target attribute the new web page may launch in a separate browser window as a result of the anchor tag.
What is a target attribute?
The response that's also received within a week of submitting the form is displayed according to the name or keyword specified by the target attribute. The target attribute specifies a browsing context's name or keyword (e.g. tab, window, or inline frame).
A target attribute with the value " self" opens the linked document in the same frame where it was clicked.
_blank: This specifies that the link should be opened in a new window.
_self: This is the default setting. It is used to open the link in the same window as the link.
_top: This opens the document linked in the main body.
_parent: This specifies that the link should be opened in the parent frameset.
framename: The document is opened in the frame name specified.
Hence to conclude target attribute of the anchor tag can cause the new web page to open in its own browser window.
To know more on target attribute follow this link
https://brainly.com/question/28341861
#SPJ1
Which system board has a 64-bit bus?
Answer: https://en.wikipedia.org/wiki/64-bit_computing
64-bit computing - Wikipediaen.wikipedia.org › wiki › 64-bit_computing
In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits (8 octets) wide. Also, 64-bit central processing unit (CPU) and arithmetic logic unit (ALU) architectures are those that are based on processor registers, address buses, or data buses of that size. ... With no further qualification, a 64-bit computer architecture ...
History · 64-bit operating system... · 64-bit applications · 64-bit data models
Explanation: