Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In [1]: myvar = { 1:{'name': 'joe', 'age' : 20), 2:{'name': 'john', 'age' : 30}} In [4]: #1.1: What is the type of this variable.
In [1]: myvar = { 1:{'name': 'joe', 'age' : 20), 2:{'name': 'john', 'age' : 30}} In [4]: #1.1: What is the type of this variable. print(' (myvar)) :2: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma? >>:2: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma? :2: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma? print('myvar.get' (myvar)) TypeError Traceback (most recent call last) in 1 #1.1: What is the type of this variable. ----> 2 print('myvar.get' (myvar)) TypeError: 'str' object is not callable In (): #1.2: We want to show joe as the result of the following code, # complete the following command such that it shows joe. print(myvar '?''?') In [ ]: #1.3: We want to add a new element to this variabe, #the person that we want to add is Mike, 25 years old. # complete the following commands. myvar(3] = '?' myvar[3]'?' = 'Mike' myvar(3]'?' = 25 print(myvar) In [ ]: #1.4. Now, we want to find the average of ages. # complete the following commands. x = 7 for vari in myvar.'?': x += '7' mean = x/'?' print(mean) Q3 (2 points) Create a function space_lower_upper_count that accepts a string and returns a dictionary that contains the count for spaces, upper and lower case characters in that string. For example "Texas State" should get {'spaces':1, 'lower': 8, 'upper:2}. In [ ]: # write your code here: Q4. (2 points) In [ ]: # run this code first ! pip3 install COVID19Py In [ ]: # run this code as well. import COVID19Py covid19 = COVID19PY.COVID190) location = covid19.getLocationByCountryCode("US") print(location) Based on the above data, find covid-19 infection rate and death rate? In [ ]: # infection rate: In [ ]: # death rate Q5 (2 points) Consider the following text. Find the frequency of the words in this text. In [27]: strl= " The Master of Science in Business Analytics is an approved Science, Technology, Engineering and Mathematics (STEM) program. The program offers students from business and non-business backgrounds an opportunity to develop expertise in the art and science of business analytics in this high-demand field. Students will learn how to collect, organize, analyze, optimize and interpret Big Data. The program emphasizes decision-making skills to apply Big Data findings to business challenges. Our faculty have been involved in research on social media, organization behavior analytics, service computing, business analytics, reliable distributed systems, web databases and semantic integration systems. Learn statistical and research methods. Acquire knowledge in database management and data warehousing. Identify, document, model, assess and improve core business processes. Appreciate relevant business trends in the marketplace and consumer behaviors. Develop skills that prepare you for the demands of the global business environment. Enhance your project management skills including initiation, planning, execution, controlling and closing projects. Investigate the technologies, methods and practices that foster innovation, new business opportunities and new efficiencies. In ( ): # write your code here: Q2. (2 points) Considere the following variable. In ( ): Students_Info={'lloyd' : { "name": "Lloyd", "homework": 190.0,97.0,75.0,92.0), "quizzes": [88.0,40.0,94.0], "tests": [75.0,99.0] 'alice': { "name": "Alice", "homework": [100.0, 92.0, 98.0, 100.0], "quizzes": [82.0, 83.0, 91.0], "tests": [89.0, 97.0] }, tyler': { "name": "Tyler", "homework": [0.6, 87.0, 75.0, 22.0], "quizzes": (0.0, 75.0, 78.0), "tests": [100.0, 100.0] }} In (5): # 2.1. Show Lloyd's all info print("lloyd.get") lloyd.get In (): # 2.2. Show Lloyd's Homework grades In [ ]: # 2.3. Show Lloyd's last grade on the homework. In [ ]: # 2.4. Show Lloyd's average on homework if all of them have the same percentages
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started