Answer:
def Average(num):
if num == 0:
return 0
val = 0
trueNum = num
for i in range(0, num):
try:
val += int(input("Enter value (%d out of %d): " % (i+1,num)))
except Exception as e:
print ("Error processing value. Non integer detected.")
try:
val += int(input("Enter value (%d out of %d): " % (i+1,num)))
except Exception as e:
print ("Error processing value. Non integer detected.")
print ("OMITTING value from average.")
trueNum -= 1
return val/trueNum
def main():
try:
num = int(input("Enter a value N for amount of items: "))
if num < 0:
raise(ValueError)
except ValueError:
print ("N must be positive integer.")
exit(1)
print("Average: ", Average(num))
exit(0)
if __name__ == "__main__":
main()
Explanation:
This program is written in Python to collect some integer value from the user as an upper bound of integers to be input for an average. Using this upper bound, the program checks to validate it is indeed an integer. If it not an integer, then the program alerts the user and terminates. If it is a user, the Average function is called to begin calculation. Inside the Average function, the user is prompted for an integer value repeatedly up until the upper bound. Using the sum of these values, the program calculates the average. If the user inputs a non integer value, the program will alert the user that the value must be an integer and ask again. If the user again inputs a non integer value, that iteration will be omitted from the final average. The program this prints the calculated average to the user.
Cheers.
what feature should be used before a document is printed
Print preview is a feature that displays on the screen what a hard copy would look like when printed. By using print preview, you can find any errors that may exist or fix the layout before printing, which can save ink or toner and paper by not having to print more than once.
Drag the tiles to the correct boxes to complete the palrs.
Match the types of letters with their descriptions.
letter of interest
cover letter
thank you letter
letter of recommendation
discusses how you meet job requirements
>
reiterates why you're the best candidate for the job
>
tells more about your character and who you are
expresses your interest in working for a company
Answer:
Letter of interest> tells you more about your character and who you are expresses your interest in working for a company
Letter of recommendation> reiterates why you're the best candidate for the job
Cover letter> discusses how you meet job requirements
Hope this helped!
Answer:
Discusses how you meet job requirements = Cover Letter
Expresses your interest in working for a company = Letter of Interest
Tells more about your character and who you are = Letter of Recommendation
Reiterates why you're the best candidate for the job = Thank You Letter
What are url addresses for visiting websites? And what are the different parts of a URL? Answer it in a 1-2 paragraph
Answer:
Please read explanation
Explanation:
URL is the short form for "Uniform Resource Locator". A uniform resource locator tells the location of a website to the browser.
Parts of URL:
There are three main parts of URL
ProtocolDomain nameExtensionProtocol defines the type of protocol used for communicating with the website while the domain name is the name assigned to the IP address and the mapping is stored in domain name server and extension tells the type of website i.e.
.com means commercial
.org means non-profitable organization
.edu means educational website
An additional element is path which change with the website navigation.
Files can be stored on hard drives, network drives, or external drives, but not in the cloud.
True
False
Folders provide a method for organizing files.
True
False
Answer: (1) False, (2) True
Explanation:
If a function is called more than once in a program, the values stored in the function's local variables do not _________ between function calls. g
Answer:
persist
Explanation:
Calling a function Within a program, can be regarded to as specifying of the name of the function when it is within a statement or it could be by the function itself, it possible for a particular function to call another function, in a case wherby a function returns a value, assignment or using the value to variable is not necessary. It should be noted that If a function is called more than once in a program, the values stored in the function's local variables do not persist between function calls
turns on her laptop and gets the error message "OS NOT FOUND." She checks the hard disk for damage or loose cable, but that is not the case. What could be a possible cause?
Which statement is true?
1)A deque is a type of collection,
2)A collection is a type of deque.
3)A list is a type of deque.
4)A deque is a type of list.
Answer:
1. A deque is a type of collection.
Explanation:
The statement that is true is as follows:
A deque is a type of collection.Thus, the correct option for this question is A.
What is Deque?Deque may be defined as an ordered and systematic collection of items similar to the queue. It is also known as a double-ended queue. It consists of two ends, a front, and a rear, and the items remain positioned in the collection.
According to the context of this question, a deque is a kind of collection that holds data and information identical to a queue. From here, elements can be added to or eliminated from either the front or back very efficiently.
It is also often called a head-tail linked list. Though properly this signifies specific data with appropriate structure that has been the implementation of a deque.
Therefore, a deque is a type of collection that is a true statement. Thus, the correct option for this question is A.
To learn more about Deque, refer to the link:
https://brainly.com/question/16750037
#SPJ2
Hi, Everybody i have a question it is almost my B-day i want this lego set
(Nintendo Entertainment System™) BUT THEY ARE SOLD OUT
I NEED HALP
Answer:
You can look at different websites of look on an app for people selling it, or something :p
Explanation:
Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces. Sample output for the given program: (must be in python)
90 -> 92 -> 94 -> 95
Note: There is a space after 95.
------------------------------------------------------------------------------------------------------------------------
hourly_temperature = [90, 92, 94, 95]
for temp in hourly_temperature:
for index,temp in enumerate(str(temp)):
if index != len(temp)-1:
print(temp,'->',end=' ')
else:
print(temp, end='')
print('') # print newline
------------------------------------------------------------------------------------------------------------------------
My expected out is:
90 -> 92 -> 94 -> 95
I keep getting:
90 -> 92 -> 94 -> 95 ->
NOTE: I can't edit the last line "print('') #print newline"
Answer:
Following are the code to this question:
hourly_temperature = [90, 92, 94, 95]#defining a list that holds values
c= 0#defining a variable c
for temp in hourly_temperature:#defining a for loop to count list values
c+= 1#defining c variable to increment the value of c
for index,temp1 in enumerate(str(temp)):#defining for loop for spacing the list value
if index == len(str(temp))-1 and c!= len(hourly_temperature):#defining if block that checks the length of list
print(temp1,'->',end=' ')#print value
elif c == len(hourly_temperature) and index == len(str(temp)) - 1:#defining elif block that checks the length of list
print(temp1, end=' ')#print value
else:#defining else block
print(temp1, end='')#print value
Output:
90 -> 92 -> 94 -> 95
Explanation:
In the above-given code, a list "hourly_temperature" is declared, in which an integer variable c is declared, that holds an integer value that is equal to 0, and two for loop is declared, and in the first loop is used for count list value, and inside the for loop is uses enumerate method to assigns an index for each item and use the conditional statement to check each list value and provide space in each element value.
As an interviewer, it is not necessary to be at eye level with interviewee
True
False
Answer:
True
Explanation:
Have a great day
Answer:
True
Hope this helps
While your hands are on home row, both of your thumbs are on _____.
Answer:
While your hands are on home row, both of your thumbs are on Space-barI know this will definitely help✍️✍️✍️