Python First Year Exam Overview

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the expected duration of the exam this year?

  • 150 minutes
  • 240 minutes
  • 2 hours and 55 minutes (correct)
  • 80 minutes

How many questions will be included in this year's Part I of the exam?

  • 14 questions
  • 20 questions (correct)
  • 16 questions
  • 10 questions

What major difference is noted between this year's exam and last year's?

  • This year includes two parts instead of one.
  • The total number of questions has decreased.
  • Python is being taught instead of R. (correct)
  • It is entirely open book this year.

What is stated about the questions that are irrelevant for this year?

<p>Students can attempt to answer them. (B)</p> Signup and view all the answers

What type of questions follow the initial multiple choice questions in the exam?

<p>Predicting output or coding questions (A)</p> Signup and view all the answers

Which of the following words correctly describes the built-in Python objects .flatten, .mean, .reshape, and .rename?

<p>Methods (C)</p> Signup and view all the answers

If you assign x = '2012-02-28' in Python, which data type is assigned to x?

<p>String (B)</p> Signup and view all the answers

Given the list a = [2, -4, 1, -5, 3, -10], which command will output -5?

<p>print(a[3]) (C)</p> Signup and view all the answers

Which statement correctly creates a Python list consisting only of integer values?

<p>vec = [90, 30, -199, 9] (C)</p> Signup and view all the answers

What will be the output of calling f(2) if the function is defined as follows: def f(x): z = 4; def g(y): return y + z; return x + g(x) and z = 5?

<p>8 (A)</p> Signup and view all the answers

Which pandas operation would successfully transform the city_income DataFrame into a wide format with separate columns for male and female income?

<p>city_income.pivot(index='city', columns='gender', values='income') (A)</p> Signup and view all the answers

When using the print(a[-5]) statement on the list a = [2, -4, 1, -5, 3, -10], what value is output?

<p>2 (D)</p> Signup and view all the answers

In Python, which of the following data types includes a series of numeric values and is defined with square brackets?

<p>List (A)</p> Signup and view all the answers

What will city_income.groupby('gender').mean() return when applied to the city_income DataFrame?

<p>A DataFrame showing average income for each gender (A)</p> Signup and view all the answers

Flashcards are hidden until you start studying

Study Notes

General Exam Information

  • First year implementing Python in this class, differing from previous R course curriculum.
  • Part I of the exam scheduled for 150 minutes with approximately 20 questions.
  • Comments made for irrelevant questions that were not covered in the course material.
  • No Part II for this year's exam.

Final Exam Overview

  • Course: GBA 464: Programming for Analytics.
  • Instructor: Yufeng Huang.
  • Exam date: August 23, 2023.
  • Total duration of exam: 2 hours and 55 minutes, split into two parts.
  • Part I duration: 80 minutes, consisting of 14 questions worth 70 points.
  • First six questions are multiple choice; subsequent eight involve coding or predicting output.
  • Closed book exam, one letter-sized cheat sheet permitted.
  • All students must comply with the Simon Academic Honesty Policy.

Question Highlights

  • Question 1: Identifies built-in objects in Python; correct answer is Methods (D).
  • Question 2: Assigning x = "2012-02-28" results in a String (C).
  • Question 3: Fetching the output -5 from a list using print(a[3]) is correct (B).
  • Question 4: A list containing only integers is vec = [90, 30, -199, 9] (C).
  • Question 5: Function output from f(2) after considering variable scope, correct answer is 8 (A); variable scoping not covered in class, so students can skip this question.
  • Question 6: To convert DataFrame to wide format, the correct operation is city_income.pivot(index='city', columns='gender', values='income') (A).

Suggestions for Preparation

  • Focus on understanding Python objects, data types, lists, and functions.
  • Familiarize with pandas DataFrame manipulation, including pivot operations.
  • Review academic honesty policy to maintain integrity during the exam.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Python Programming Exam Questions
24 questions
PCAP-31-03 Python Exam Quiz
16 questions

PCAP-31-03 Python Exam Quiz

HeartwarmingInfinity3869 avatar
HeartwarmingInfinity3869
Use Quizgecko on...
Browser
Browser