Login using Social Account
     Continue with GoogleLogin using your credentials
We have the following data of first names, last names and marks of students:
student_first_name = ['Jonas', 'Rob', 'Alex', 'John']
student_last_name = ['Gates', 'Hook', 'Wilson', 'Gray']
marks = [90, 79, 96, 85]
Create a function named create_students_df
which:
first_names
, last_names
and marks
as input argumentsDefine a variable student_first_name
with and array of elements: ['Jonas', 'Rob', 'Alex', 'John']
Define a variable student_last_name
with and array of elements: ['Gates', 'Hook', 'Wilson', 'Gray']
Define a variable marks
with and array of elements: [90, 79, 96, 85]
Create the function with the name create_students_df
that takes three arguments that takes three arguments first_names
, last_names
and marks
and returns a data frame which looks as shown in the above image.
Your function must return the output, it should not print the output.
Call the function create_students_df
with the three arguments student_first_name
, student_last_name
and marks
and assign the returned data frame to students_df
.
The first column of the data frame students_df
should be Full Name
, and the second column should be Marks
. Make sure to preserve this order as shown in the image
There should be space between the first name and the last name in the Full Name(ie, the Full Name of the person - whose first name is Jonas and last name is Gates - must be
Jonas Gates
, but not JonasGates
.
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...