In Python, to make a variable inside a class private so that functions that are not methods of the class (such as main() ) cannot access it, you must _____________   write the word private then a space before the variable name   write the word hide then a space before the variable name   start the name of the variable with two underscores   do nothing because Python variables declared inside a class are private by default

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question

In Python, to make a variable inside a class private so that functions that are not methods of the class (such as main() ) cannot access it, you must _____________

 
  1. write the word private then a space before the variable name

     
  2. write the word hide then a space before the variable name

     
  3. start the name of the variable with two underscores

     
  4. do nothing because Python variables declared inside a class are private by default

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT