<< < 1 2 3 4 5 6 >   ∑:128  Sort:Date

'break' Statement in Repeating Statement Blocks
How to use the "break" statement in a repeating statement block in Python code? The "break" statement can be used in a repeating statement block like "for" and "while" loops to terminate the loop immediately. When a "break" statement is interpreted, Python will terminate execution of the nearest "fo...
2018-02-28, ∼2111🔥, 0💬

'break' Statement in Repeating Statement Blocks
How to use the "break" statement in a repeating statement block in Python code? The "break" statement can be used in a repeating statement block like "for" and "while" loops to terminate the loop immediately. When a "break" statement is interpreted, Python will terminate execution of the nearest "fo...
2018-02-28, ∼2111🔥, 0💬

Pass Function as Function Parameter
How to pass function objects as function parameters? You can pass function objects like any other types of objects as parameters of other functions. For example, &gt;&gt;&gt; def x(): ... print("Hello world!") ... &gt;&gt;&gt; def addVersion(f): ... f.version = "1.0" ... f.au...
2018-02-08, ∼2103🔥, 0💬

'int' Values are Objects
Are "int" values objects in Python? Yes, "int" values are objects in Python. In fact, all data values in Python are objects. In Python, "int" is defined as an object class with the following interesting properties, constructors, and methods: int.__doc__ - Property holding a short description of "int...
2023-07-01, ∼2097🔥, 0💬

Comments in Python Code
How to enter comments in Python Code? There is only one way to enter comments in Python code. That is to enter them at the end of any code line preceded by the hash character "#". For example: # this is the first comment x = 1 # and this is the second comment # and now a third!   ⇒ 'if ... elif ... ...
2023-06-12, ∼2087🔥, 0💬

'str' Literals and Conversions
How to specify "str" values in Python code? "str" values can be specified using "str" literals or the str() conversion function as shown in this tutorial: 1. "str" literals in double quotes as shown below: &gt;&gt;&gt; "FYIcenter.com" 'FYIcenter.com' &gt;&gt;&gt; "He says: \"...
2018-04-07, ∼2080🔥, 0💬

'return' Statement in Function Statement Block
How to use the "return" statement in a function statement block in Python? The "return" statement can be used in a function statement block to terminate the execution of the function and return a data object to the calling expression. Here is a good example of "return" statement used in a function s...
2018-02-28, ∼2077🔥, 0💬

'return' Statement in Function Statement Block
How to use the "return" statement in a function statement block in Python? The "return" statement can be used in a function statement block to terminate the execution of the function and return a data object to the calling expression. Here is a good example of "return" statement used in a function s...
2018-02-28, ∼2077🔥, 0💬

'list' Literals and Conversions
How to specify "list" values in Python code? "list" values can be specified using "list" literals or the list() conversion function as shown in this tutorial: 1. "list" literals in [v1, v2, ...] format as shown below: &gt;&gt;&gt; ["Age", 25] ['Age', 25] &gt;&gt;&gt; ["Age", ...
2018-04-07, ∼2068🔥, 0💬

'str' Values are Objects
Are "str" values objects in Python? Yes, "str" values are objects in Python. In fact, all data values in Python are objects. In Python, "str" is defined as an object class with the following interesting properties, constructors, and methods: str.__doc__ - Property holding a short description of "str...
2022-12-03, ∼2056🔥, 0💬

Cursor.execute() with PyMySQL
How to use Cursor to run MySQL statements with PyMySQL package? PyMySQL package provides you 2 ways to run MySQL statements: 1. Use con.query() - If you don't want to receive any data back from the MySQL server, you can use the Connection.query() method to run MySQL statements. 2. Use cur.execute() ...
2021-09-09, ∼2055🔥, 0💬

'class' - Class Definition Statements
How to use the "class" statement to define a new function in Python? You can use the "class" statement to define a new class in Python with the following syntax: def class_name(base_class): class properties assignment statement ... method definition statement ... Here is a good example of "class" st...
2018-05-08, ∼2039🔥, 0💬

Parameter List in Function Definition Statements
How to specify parameters in the "def" statement to define a new function in Python? When defining a function, you can specify the parameter list as a comma separated list of variables with or without default values in the following syntax: def function_name(variable,variabl e,...,variable=default_va...
2022-10-26, ∼2035🔥, 0💬

What Is Module Package
What Is Module Package in Python? A module package in Python is a collection of Python module files saved in a file directory with a special file called __init__.py. A module package can have the following elements: Package name - A symbolic name that uniquely identifies this module package within t...
2022-08-26, ∼2033🔥, 0💬

Basic Structure of Python Code
What is Basic Structure of Python Code? The basic structure of Python code can be described below: A Python code is a sequence of statements and statement blocks. Each statement or statement block in a Python code is executed sequentially one by one. For example, look at the following Python code wi...
2023-06-12, ∼2027🔥, 0💬

Modules Are Objects Too
Are modules objects in Python? Yes, all modules are objects of "module" type in Python? You can verify this with the following Python code: &gt;&gt;&gt; import firstModule &gt;&gt;&gt; type(firstModule) &lt;class 'module'&gt; In other words, the "import firstModule" s...
2022-08-26, ∼2026🔥, 0💬

'bytes' Literals and Conversions
How to specify "bytes" values in Python code? "bytes" values can be specified using "bytes" literals or the bytes() conversion function as shown in this tutorial: 1. "bytes" literals in b'...' or b"..." format as shown below: &gt;&gt;&gt; b'FYIcenter.com' b'FYIcenter.com' &gt;&gt...
2018-04-07, ∼2026🔥, 0💬

What Is Python Module 'json'
What Is Python module "json"? "json" is a Python internal module that allows to encode and code JSON strings. Here are some important properties and functions provided by the "json" module: &gt;&gt;&gt; import json &gt;&gt;&gt; json.dumps() # serializes a given object into a ...
2018-10-13, ∼2017🔥, 0💬

'bool' Values are Objects
Are "bool" values objects in Python? Yes, "bool" values are objects in Python. In fact, all data values in Python are objects. In Python, "bool" is defined as a sub class of the "int" object class with the following interesting properties, constructors, and methods: bool.__doc__ - Property holding a...
2023-07-01, ∼2013🔥, 0💬

Classes Are Objects Too
Are classes objects in Python? Yes, all classes are objects of "type" type in Python? You can verify this with the following Python code: &gt;&gt;&gt; class x: ... pass ... &gt;&gt;&gt; type(x) &lt;class 'type'&gt; In other words, the "class x" statement block perform...
2018-05-08, ∼2007🔥, 0💬

Understanding Data Values as Objects
Where to find tutorials on Understanding Data Values as Objects? Here is a list of tutorials to answer many frequently asked questions compiled by FYIcenter.com team on Understanding Data Values as Objects: 'int' Values are Objects 'bool' Values are Objects 'float' Values are Objects 'str' Values ar...
2023-07-01, ∼2006🔥, 0💬

MySQL Database Server Connection Information
What information is needed to connect to a MySQL database? In order to connect to a MySQL database server, you need to get the following information from your DBA: Host Name: This is the host name on the network, or the IP address that runs the MySQL database server. Port Number: This is the port nu...
2021-11-13, ∼2001🔥, 0💬

'__dict__' Dictionary in Function Object
What is the "__dict__" dictionary property in a function object? By default every function object has "__dict__" built-in dictionary property. Each name value pair in this dictionary becomes a formal property of the function object accessible using the "." operation. It is empty when the function ob...
2018-02-08, ∼1988🔥, 0💬

Variable Scope in Function Definition Statements
What is the scope of a variable introduced in a function definition "def" statement block in Python? Any new variables introduced in a function statement block is valid only in that statement block. In other words, the scope of a local variable in a function is limited to the function only. Also not...
2022-10-26, ∼1971🔥, 0💬

<< < 1 2 3 4 5 6 >   ∑:128  Sort:Date