Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

I can not figure out how to make numbers add up at the bottom! help please! I dont know what I am doing wrong!

print('Please enter customers name')
myName = input()
print ('Please enter data usage')
myData = int(input())
if myData > int(str(int(5) +10)):
print ('Please enter minutes used')
myMinutes = int(input())
if myMinutes > int():
print ('Please enter number of texts')
myTexts = int(input())
print('Please enter state tax')
myTax = int(input())
print('Your bill is' = str(int(myData) + (int(myMinutes) + int(myTexts) + int(myTax) + 'for September.'):
A game contains sound effects. Explain 2 ways that the sound files could be made smaller so that the game can be played on mobile devices.
# Given an integer n, return the number of digits of n.
def digitCount(n):
return 42


# Given an integer n, return the sum of its digits.
def digitSum(n):
return 42


# Definition: For a positive integer n, n factorial, denoted n!,
# is the product n*(n-1)*(n-2)*...*1. If n = 0, then define 0! as 1.
# Given an integer n (which you can assume is non-negative),
# return n! (n factorial).
def factorial(n):
return 42


# Definition: We say that m is a factor of n if m divides n without a remainder.
# Given an integer n (which you can assume is positive),
# return the smallest factor of n larger than 1.
# If n is 1, then you should return 1.
def smallestFactor(n):
return 42
Write a program that uses the keys(), values(), and/or items() dict methods to find statistics about the student_grades dictionary. Find the following:
Print the name and grade percentage of the student with the highest total of points
Find the average score of each assignment.
Find and apply a curve to each student's total score, such that the best student has 100% of the total points.
student_grades = {
'Andrew': [56, 79, 90, 22, 50],
'Colin': [88, 62, 68, 75, 78],
'Alan': [95, 88, 92, 85, 85],
'Mary': [76, 88, 85, 82, 90],
'Tricia': [99, 92, 95, 89, 99]
}
You are designing an algorithm that ranks website pages by relevance according to the number of times they are viewed by users. Which data structure would be the most useful and efficient for you to use?

A hash table because data would be efficiently searched and retrieved

A stack because the website pages would need to be popped and pushed systematically from the ranking list

A graph because Elizabeth needs data relating to how webpages are connected to each other and how many times they were viewed

A sorted array because all the data relating to web pages needs to be sorted in a ranking order

None of the above
Of the following statements, which ones can be said to be TRUE?


The time complexity of all single statements is constant

According to the Big O Notation, the time complexity of some statements can be said to be logarithmic

Time complexity can only be expressed by using the Big O notation

Time complexity can be expressed as a differential equation

The time complexity of an algorithm can vary over time

Quadratic time complexity can be expressed as a quadratic equation

1, 3 & 5

2 & 4

5, 2 & 6

2 & 6

2, 4 & 6
.In relation to both primitive and complex data structures, what CANNOT be said to be TRUE?
1.Primitive data structures are used to represent semantically independent values whilst complex data structures are NOT

2.Complex data structures are used to represent interdependent values

3.Complex data structures are complicated to use whilst basic data structures are simple to use

4.Basic data structures can be used out of the box in a programming language

5.Complex data structures should only be used with a large data set

1 & 3

4 & 2

2 & 3

3 & 5

5 & 1
2.You have a subscription input field on a client’s website and need a method to ensure that any email address and username in the client's database is unique. What should you use to achieve this?

An ordered list because Grace needs to know when each user subscribed to the website

A set because each username and email needs to be singular

A slice because Grace will have to extract the names of each user from their email address

A dictionary because she needs to link each user's name to their email address

None of the above
1.You are designing an algorithm that ranks website pages by relevance according to the number of times they are viewed by users. Which data structure would be the most useful and efficient for you to use?

A hash table because data would be efficiently searched and retrieved

A stack because the website pages would need to be popped and pushed systematically from the ranking list

A graph because Elizabeth needs data relating to how webpages are connected to each other and how many times they were viewed

A sorted array because all the data relating to web pages needs to be sorted in a ranking order

None of the above
1.You are creating an inventory management system in Python. You want the following features:

The name of every item should be linked to its stock level and expiry date
The order of the items in the database is not a priority
You need to be able to easily lookup data for each item


Which is the best representation of the optimal data structure you should use to manage the data in this application?
Canned Soup , [45 , 16/12/2016]

‘Canned Soup’ ’45’ ’16/12/2016’

{ ‘Canned Soup’: [45, '16/12/2016'] }

‘Canned Soup, 45, 16/12/2016’

[ ‘Canned Soup’ , 45 , 16/12/2016 ]

def inventory(item,stock_level,expiry)

{ ‘Canned Soup’: 45, ‘Canned Soup’:16/12/2016 }

2.Which of the following best describes a LIST comprehension?

lc = [ x * 2 for x in [1, 2, 3] ]

lc = {x for x in ‘apple’ if x not in [‘a’, ‘e’, ‘i’]}

lc = (x for x in ‘apple’ if x not in [‘a’, ‘e’, ‘i’])

lc = x * 2 for x in [1, 2, 3]’

None of the above
LATEST TUTORIALS
APPROVED BY CLIENTS