Что делает следующий код def a b c d pass
Перейти к содержимому

Что делает следующий код def a b c d pass

  • автор:

pass

В ходе исполнения данного оператора ничего не происходит, поэтому он может использоваться в качестве заглушки в тех местах, где это синтаксически необходимо, например: в инструкциях, где тело является обязательным, таких как def, except и пр.

Зачастую pass используется там, где код пока ещё не появился, но планируется. Кроме этого, иногда, его используют при отладке, разместив на строчке с ним точку остановки.

Во многих случаях вместо pass можно сделать что-нибудь более полезное:

 try: 
some_func()

except AttributeError:
pass # Возможно стоит хотя бы записать исключение в журнал.


class MyException(Exception):
pass # Здесь лучше добавить строку документации для класса.


class MySubclass(MyClass):

def do_something(self):
pass
# Подобное «перекрытие» родительского метода — возможный индикатор
# проблем проектирования интерфейса.


with my_context() as my:
pass
# При таком подходе теряется сам смысл менеджера контекста.

What does the following code do? def a(b, c, d): pass

CLASS 8 FOUNDATION COURSE

Please log in or register to add a comment.

1 Answer

Please log in or register to add a comment.

Find MCQs & Mock Test

  1. JEE Main 2024 Test Series
  2. NEET Test Series
  3. Class 12 Chapterwise MCQ Test
  4. Class 11 Chapterwise Practice Test
  5. Class 10 Chapterwise MCQ Test
  6. Class 9 Chapterwise MCQ Test
  7. Class 8 Chapterwise MCQ Test
  8. Class 7 Chapterwise MCQ Test

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

  • All categories
  • JEE (32.5k)
  • NEET (8.9k)
  • Science (771k)
  • Mathematics (249k)
  • Statistics (2.9k)
  • Environmental Science (5.4k)
  • Biotechnology (680)
  • Social Science (123k)
  • Commerce (72.4k)
  • Electronics (3.8k)
  • Computer (20.4k)
  • Artificial Intelligence (AI) (3.2k)
  • Information Technology (14.3k)
  • Programming (13.0k)
  • Political Science (9.4k)
  • Home Science (7.7k)
  • Psychology (4.0k)
  • Sociology (6.7k)
  • English (64.5k)
  • Hindi (27.1k)
  • Aptitude (23.7k)
  • Reasoning (14.7k)
  • GK (25.8k)
  • Olympiad (532)
  • Skill Tips (86)
  • CBSE (802)
  • RBSE (49.1k)
  • General (67.0k)
  • MSBSHSE (1.8k)
  • Tamilnadu Board (59.3k)
  • Kerala Board (24.5k)

What does the following code do?
def a(b, c, d): pass

chiefprashant

the code defines a function named a which takes three arguments and does nothing.

Advertisement
Advertisement

New questions in Computer Science

what is the purpose of presentation toolbar in open office impress?​
What percentage of numbers from 1 to 20 has 7 or 3 in the units digit?​

L2 cache memory is located in______ of computer a.inside the cpub.outside the cpuc.outside the motherboard d.outside the computer ​

Search any five topics related to science and write their name​

Smita invests Rs. 1,87,000, which is 25% of her annual income in the stock market. What is Smitha’s approximate monthly income?​

Что делает следующий код def a b c d pass

Advertisement

Document details

second part of 2 tom

Published on Sep 16, 2012

Follow this publisher

second part of 2 tom

More from

sdrf

September 18, 2012

first part of 2 tom

September 16, 2012

Microsoft ASP.NET 2.0 AJAX

September 16, 2012

Programmirovanie_na_Python_2_tom

September 16, 2012

programmirovanie_na_python_1_tom.2

September 15, 2012

Read more

Advertisement

Advertisement

Advertisement

Advertisement

Advertisement

Advertisement

Create once. Share everywhere.

  • Company — About us
  • Company — Careers
  • Company — Blog
  • Company — Webinars
  • Company — Press

Issuu Features

  • Issuu Features — Fullscreen Sharing
  • Issuu Features — Social Posts
  • Issuu Features — Articles
  • Issuu Features — Embed
  • Issuu Features — Statistics
  • Issuu Features — InDesign Integration
  • Issuu Features — Cloud Storage Integration
  • Issuu Features — GIFs
  • Issuu Features — Canva Integration
  • Issuu Features — Add Links
  • Issuu Features — Teams
  • Issuu Features — Video
  • Issuu Features — Web-ready Fonts
  • Solutions — Designers
  • Solutions — Content Marketers
  • Solutions — Social Media Managers
  • Solutions — Publishers
  • Solutions — Education
  • Solutions — Salespeople
  • Solutions — Use Cases

Industries

  • Industries — Internal Communications
  • Industries — Marketing and PR
  • Industries — Publishing
  • Industries — Real Estate
  • Industries — Sports
  • Industries — Travel

Products & Resources

  • Products & Resources — Plans
  • Products & Resources — Partnerships
  • Products & Resources — Developers
  • Products & Resources — Digital Sales
  • Products & Resources — Elite Program
  • Products & Resources — Publisher Directory
  • Products & Resources — Redeem Code
  • Products & Resources — Support

Explore Issuu Content

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *