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

The baby toy store employs five cashiers – Alam, Babar, Chohan, Dilawer, and Esa – each of whom works alone on exactly one day, Monday through Friday.
Alam will works only on Tuesday or Thursday.
Babar will not work on Monday or Wednesday.
Chohan works on Friday.
Dilawer and Esa do not work on consecutive days.
sampleDict = {
"class":{
"student":{
"name":"Mike",
"marks":{
"physics":70,
"history":80
}
}
}
}
Copy the code above and write the code for accessing the ‘history’.
Write a loop that inputs words until the user enters STOP. After each input, the program should number each entry and print in this format:

#1: You entered _____
When STOP is entered, the total number of words entered should be printed in this format:

All done. __ words entered.
Sample Run
Please enter the next word: cat
#1: You entered cat
Please enter the next word: iguana
#2: You entered iguana
Please enter the next word: zebra
#3: You entered zebra
Please enter the next word: dolphin
#4: You entered dolphin
Please enter the next word: STOP
All done. 4 words entered.

(The answer posted about this, doesnt work for me)
Create a program called "Quiz"
Ask the user a true or false question.
Based on the user's response, tell them if they got it correct or not.
Accept true, True, T and t for responses that are true
Accept false, False, F and f for responses that are false
If the user enters anything other than the 8 options above, tell them that they entered an invalid answer.
Assume that a grocery shop is introducing shopping through mobile. The shop keeper will gets the list of items from the customer through whatsApp. After receiving the list he will prepare the bill for the customer based on the availability of the items. That is, the shopkeeper will check whether the item is available or not by checking the stock in the shop, if the item is available he will add that item to the bill otherwise he will add that item to another list called not-available list. Finally the shopkeeper will send the bill and the not available list to the customer for confirmation. Write a python code to simulate mobile shopping for a grocery shop to generate bill and not available list.
Write a function good_string that consumes a string, produces True if the first character is a letter and the second character is either a digit or a blank space, and produces False otherwise.
Which of the following statements is incorrect?

A. We can use s.iteritems() on a pd.Series object s toiterate on it

B. If s and s1 are two pd.Series objects, we cannot use s.append(s1) to directly append s1 to the existing series s

C. loc and iloc are two useful and commonly used pandas method

D. If s is a pd.Series object, then we can use s.loc[label] to get all the data where the index is equal label
1. Which of the following can be used to create a DataFrame in Pandas?

A. Pandas Series object
B.2D ndarray
C. Python dict
D. All of the above

2. For the Series s1 and s2 defined below, which of the following statements will give an error?

import pandas as pd
s1 = pd.Series({1: 'Alice', 2: 'Jack', 3: 'Molly'})
s2 = pd.Series({'Alice': 1, 'Jack': 2, 'Molly': 3})

A. s2.loc[1]
B. s1.loc[1]
C. s2[1]
D.s2.iloc[1]
1. import pandas as pd
d = {
'1': 'Alice',
'2': 'Bob',
'3': 'Rita',
'4': 'Molly',
'5': 'Ryan'
}
S = pd.Series(d)

In the above python code, the keys of the dictionary d represent student ranks and the value for each key is a student name. Which of the following can be used to extract rows with student ranks that are lower than or equal to 3?

A. S.loc[0:2]
B. S.loc[0:3]
C. S.iloc[0:3]
D. S,ilo[0:2]
1. What will be the output of the variable L after the following code is executed?

import re

s = 'ACAABAACAAAB'
result = re.findall('A{1,2}', s)
L = len(result)

A. 5
B. 8
C. 12
D. 4
LATEST TUTORIALS
APPROVED BY CLIENTS