#๐Ÿ”’ I don't understand the requirement

32 messages ยท Page 1 of 1 (latest)

vestal marsh
#

Here is the prompt question, its table, and my attempted code.
I'm not sure what do they mean by "create and print a list of all variables from table 1"

Did I do it correctly?

calm wyvernBOT
#

@vestal marsh

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

vestal marsh
#

Like do they really want me to print every single word in table 1 ?

silent topaz
#

i think so

#

but i ca do it with a for loop

vestal marsh
#

How?

silent topaz
#

bc i think table 1 is a list right

#

for x in table1:
print(x)

vestal marsh
#

Table1 is not defined

#

How can get the table's name

silent topaz
#

wait u have anything that is given?

formal geyser
vestal marsh
silent topaz
#

can u send the code?

#

in that screenshot

#

i think i have a idea

vestal marsh
#

I'll try

#

Dataset and metadata is given below:

EMP Age GX MS ED Min Income Max Income B12
Retired 66 Male Divorced College 1000 3000 107
full-time 27 Male Married High school 4000 50000 30
part-time 16 Female Not Married some High school 1000 2000 10
self-employed 55 Female Divorced Some college 4000 5000 40
full-time 63 Male Widowed Some college 5000 7500 92
Retired 60 Female Married College -10000 15000 86
part-time 50 Female Married Post-graduate 7500 10000 130
part-time 23 Male Not Married High school 100000 150000 50
self-employed 19 Female Not Married Some college 50000 7500 47
#

| Student | 16 | Female | Not Married | High school | 1000 | 2000 | 35 |
| Retired | 89 | Female | Widowed | Some college | 3000 | 4000 | 11 |
| Retired | 88 | Female | Widowed | Some college | 1000 | 2000 | 100 |
| Retired | 84 | Female | Widowed | Some college | 10000 | 15000 | 50 |
| Retired | 81 | Female | Married | Some college | 7500 | -100000 | 71 |
| full-time | 79 | Female | Widowed | High school | 20000 | 3000 | 49 |
| Retired | 79 | Male | Married | College | 5000 | 75000 | 100 |
| Retired | 78 | Male | Married | College | 100000 | 150000 | 102 |
| self-employed | 78 | Female | Widowed | vocational school | 10000 | 20000 | 6 |
| Retired | 76 | Female | Married | Post-graduate | 100000 | 150000 | 120 |

Column heading description

Column Description
EMP Employement
Age Age
GX Gender
MS Marital status?
ED Education level
Min Income Income_min
Max Income Income_max
B12 Books read in 12months
silent topaz
#

this one

vestal marsh
#

variables = ['Retired'66 Male Divorced College 1000 3000 107

#full-time 27 Male Married High school 4000 50000 30
#part-time 16 Female Not Married some High school 1000 2000 10
#self-employed 55 Female Divorced Some college 4000 5000 40
#full-time 63 Male Widowed Some college 5000 7500 92
#Retired 60 Female Married College -10000 15000 86
#part-time 50 Female Married Post-graduate 7500 10000 130
#part-time 23 Male Not Married High school 100000 150000 50
#self-employed 19 Female Not Married Some college 50000 7500 47
#Student 16 Female Not Married High school 1000 2000 35
#Retired 89 Female Widowed Some college 3000 4000 11
#Retired 88 Female Widowed Some college 1000 2000 100
#Retired 84 Female Widowed Some college 10000 15000 50
#Retired 81 Female Married Some college 7500 -100000 71
#full-time 79 Female Widowed High school 20000 3000 49
#Retired 79 Male Married College 5000 75000 100
#Retired 78 Male Married College 100000 150000 102
#self-employed 78 Female Widowed vocational school 10000 20000 6
#Retired 76 Female Married Post-graduate 100000 150000 120']

silent topaz
#

so they want to print all of that

vestal marsh
#

Appearantly?

silent topaz
#

like this?

vestal marsh
#

In a list

#

Maybe every variable should be put as a string in a list

#

But the table is big

silent topaz
#

yea, u need to make it all to strings then. ig make lists in a list

#

then u can do more with it

vestal marsh
#

isnt there a more practical way?

calm wyvernBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.