PS - QUIZ PART 1

A colorful illustration showing a person taking an online programming quiz with elements of SAS and Python code in the background.

SAS & Python Programming Quiz

Test your knowledge with our challenging quiz that covers SAS programming and Python coding concepts. Whether you're brushing up on your skills or preparing for a certification, this quiz is designed for you!

  • Multiple choice and checkbox questions
  • Focuses on practical programming scenarios
  • Perfect for students and professionals alike
14 Questions4 MinutesCreated by CodingTiger42
  1. What is wrong in the following program?

data ord;

input age sex $ prod_id quantity order_date

mmddyy6.;

format order_date yymmdds10.;

cards;

25 f 02344 2 05/27/10

37 m 08798 4 04/29/10

45 f 09876 1 05/27/10

19 m 07897 3 05/30/10

;

Proc sort data=ord; by descending order_date;

Proc print data=ord;

Title ‘Unfulfilled orders’;

A) Data must be provided using datalines command;
B) Order_date column cannot correctly read data because there are 2 formats defined for it
C) Order_date column cannot correctly read data because the input format doesn’t correspond to provided data
D) Sex variable is formatted as Currency but it is a Character
Which answer is incorrect?
A) Labels are used to explain some short names
B) Labels are created in DATA step
C) Formats are created in DATA step
D) Formats are used to show the information in a more attractive way

What is the output of the following Python code:

X = 2

Y = 10

X *= y * x + 1

41
42
40
39
03/26/2001 is represented by the following SAS output format:
A) MMDDYY10.
B) MM/DD/YYYY
C) MM/DD/YY
D) MMDDYY.8
It doesn’t represent an advantage for saving query results in views:
A) Saves memory space because of its smaller size
B) Makes sure that the input data is always updated
C) Hide from the user joins or complex queries
D) Results are formatted for being displayed
If your work with flat files separated by comma:
1. Can use dsd option
2. Can use dsc option
3. Can use dlm option
4. Can use dlv option
5. Must mention the size of variables
6. Character variables must be specified between brackets
  1. Having the SAS program:

Data food;

               Set examples.products;

               Where category eq “food”;

Run;

Which of the following programs is equivalent to the initial one?

Data food; Set examples.products; if category eq “food”; Run;
Data food; Set examples.products; where category ne “food”; Run;
Data food; Set examples.products; if category gt “food”; Run;
Data food; Set examples.products; if category == “food”; Run;
  1. What is the output of the following Python code:

if 'bar' in {'foo':1, 'bar':2, 'baz':3}:

    print(1)

    print(2)

    if 'a' in 'qux':

        print(3)

print(4)

1, 2, 4
Doesn't generate any output
4
1, 2, 3, 4
9. Which of these is not a Python data type:
A) Int
B) Decimal
C) Boolean
D) Float
10. SAS Enterprise Guide can read and use data in the following formats:
A) SAS tables, Excel spreadsheets
B) SAS tables, flat files
C) PHP files, SAS tables
D) Excel spreadsheets, flat files, SAS tables
11. Which statement is true regarding the result of a SAS query:
A) A report result can be PDF, HTML or XLS format
B) A report result is automatically updated
C) A data table result is automatically updated
D) A view result is automatically updated
12. Which of the following removes an element from a list in Python?
A) List.delete()
B) List.remove()
C) List.delete(-1)
D) List.remove(-1)
13. In SAS tasks can be performed directly on:
A) Excel files
B) Flat files
C) SAS data tables
D) All of the above
  1. Having the following SAS code:

Data products;

               Infile ‘C:\examples\products.txt’;

               Input @1 Name $7

                         @8 Price dollar4.

                         @12 Category $8.

Format Price dollar6.0;

Run;

A) The output file is a permanent SAS data table
B) The input file contains 2 character variables and a number variable
C) The price will be displayed over 4 characters
D) Products.txt file is space limited
{"name":"PS - QUIZ PART 1", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge with our challenging quiz that covers SAS programming and Python coding concepts. Whether you're brushing up on your skills or preparing for a certification, this quiz is designed for you!Multiple choice and checkbox questionsFocuses on practical programming scenariosPerfect for students and professionals alike","img":"https://cdn.poll-maker.com/104-5107484/img-8vs43wuu1orchufzofljwvrd.jpg"}
Powered by: Quiz Maker