Python basics _ type_dict, python basics _ dict
# The dict dictionary is not as suitable as the key-value dictionary. I don't know how this name came from. It can be used for usernames and passwords, but isn't it too low to use this database?
# Expand with braces {} and separate each element with commas (,). Each element must have key and value, and key and value are separated by colons.
A = {'A': 1, 'B'
01Python basics _ 09 exception, 01Python basics _ 091. try try t
Original program:
1 import math2 3 while True:4 text = raw_input('> ')5 if text[0] == 'q':6 break7 x = float(text)8 y = math.log10(x)9 print "log10({0}) = {1}".format(x, y)View Code
This code receives the input from the command line. When the input is a number, calculate its logarithm and output it until the input
Inner class BasicsClasses are defined inside the class, either in the member's inner class or in the local inner class (inside the method)First, members of the internal class① can have access modifiers②class File Name: External class class name $ internal class class name. class③ is a complete, independent class④ can be new in any of these non-static places, but external class objects must be used in third parties. New way of generating inner classStudent s = outside.new Student ();⑤ static inne
Python basics and python Basics
Variables and assignments
Name = 'kevin ': if the value of a variable is of the str type, it must be caused ''.
Age = 21: ''is not required if it is an int''
Variables and names
Easy to understand: it is best to be knowledgeable
Nums_of_kevin_gf = 10
NumsOfKevinGf = 20: hump method
Name-of-kevin-gf = 10: the non-standard naming method triggers a
Python function basics 2: python function Basics
1. What are naming keyword parameters?
Format: All parameters after * are named keyword parameters.
Features: 1. The caller of the constrained function must pass the value in the form of Kye = value.
2. The caller of the constraint function must use the specified Key name.
def auth(*args,name,pwd): print(name,pwd)auth(pwd='213',name='egon')def register(nam
Python self-learning log-basics (1) and python Basics
From Understanding python to learning python, I experienced a long time of psychological struggle. People always have a natural fear of unknown things, but they are curious about the unknown. In the end, I opened this door and started to learn python.
Python is actually quite interesting. This article mainly introduces python in basic aspects.
1. install
Java basics --- Exception Handling, java basics Exception Handling
Recognition exception
An instruction stream that causes program interruption when an exception occurs. If the exception is not correctly handled, the program may be interrupted and cause unnecessary losses, therefore, in the program design, we must consider the occurrence of various exceptions and properly handle them so as to ensure the nor
A list of python basics and python Basics
List Function
The list function converts other types of sequences to a list, as shown in figure
>>> List ("hello world ")['H', 'E', 'l', 'l', 'O', '', 'w', 'O', 'R', 'l ', 'D']
List operations
Element assignment can change the list, as shown in figure
>>> Sen['H', 'E', 'l', 'l', 'O', '', 'w', 'O', 'R', 'l ', 'D']>>> Sen [0] = 'H'>>> Sen['H', 'E', 'l', 'l', 'O'
Java basics-annotations and java Basics
Annotation is a form of metadata that provides non-program data and has no direct impact on the annotated code.
This article mainly summarizes the usage of comments. java platform (SE) pre-defined comments. Type comments are used with the pluggable type system for stronger type checks, and how to implement repeated comments.
Annotations have many functions, including:
Java basics-generic 1 and java Basics
The use of generics can make the type name as a parameter in the class or interface definition, just like a common parameter, so that the defined type is more universal.
Advantages of generics:
Strict type check for compilation
The java compiler is more rigorous in checking the type of generic code and can detect some runtime errors in common code.
Eliminate type
Java basics-network programming, java basics Network Programming
I. IP and InetAddress
Java supports the development of network communication programs. It mainly provides two communication protocols: TCP and UDP.
Reliable connection and transmission, and third-party handshake
Unreliable connection transmission, which is not necessarily acceptable to the receiver during transmission
All network program d
() sets the Date object's month field and day number fields (World time) Date.setutcseconds () to set the Date object The seconds field and the Millisecond field (at the time of the World) Date.setyear () sets the Date object's Year field date.todatestring () to return dates as a string date.togmtstring () to convert date to world time words Character string date.tolocaledatestring () returns the date part of a Date object as a locally formatted string date.tolocalestring () Converts a da
Iterators are divided into two types: one is iterator and the other is const_iterator.Both can access the elements in the container, and the difference is:(1) The Const_iterator type can only be used to read elements within a container, cannot change its value, and iterator may change its value.(2) When a const_iterator type is dereferenced, the return value is a const value and does not allow the assignment of its dereference.Also do not confuse the Const_iterator object with the Const iterator
ListBoxAlert (oListBox.option.length)//Get the number of options in the listboxB. Get or set the selected itemalert (Olistbox.selectedindex); Gets or sets the index of the selected itemAlert (olistbox.options[olistbox.selectedindex].text)//Gets the text of the selected itemOlistbox.selectedindex =-1; setting is not selected5. Delete Options Remove an option function Dal (index) //Index of the item to delete { var olistbox = document.getElementById ("Selage");
Thinkphp BASICS (1) and thinkphp Basics
The ThinkPHP directory is as follows. Application is the meaning of the Application (our code is put here), and Public is the meaning of Public files (mainly for front-end resource files such as js css ), the ThinkPHP file is the core package of the Framework (we generally do not operate on it ). This means that the background staff should write code in the Applica
Php basics (2): php Basics
Embed PHP code on the Web page
Default syntax
Short tag
Script
ASP Style
Embed multiple code blocks
Add comments to code
Single Row C ++ syntax
Shell syntax
Multi-line C syntax
Output data to the browser
Print () Statement
Echo () Statement
Printf () Statement
Sprintf () Statement
Data Types supported by PHP
Scalar Data Type
Co
Pig C ++ note BASICS (5) expressions and statements, pig BasicsPig C ++ note BASICS (Part 5)
Keywords: expressions, statements
The content in this chapter is relatively simple, and there is basically no difficulty in understanding it. It is a matter of knowledge. I was not prepared to write it first, but now I have to take notes and write it. After all, there are some gains. So, I just put forward some poin
Development and defense of mobile games-II. BASICS (Continuous updates) and basics of mobile game development
Sorry, this article is not available until now because of the recent expansion of company members, technical training, and project issues.
Okay, let's not talk about anything else.
This article is suitable for people who have some knowledge about the basic components of Unity and want to know how t
Shell BASICS (9) functions, shell Basics
Functions allow us to divide a complex function into several modules, so that the program structure is clearer and the code reuse rate is higher. Like other programming languages, Shell also supports functions. Shell functions must be defined before use1. The Definition Format of Shell functions is as follows:
[function] fun_name () {command1[retrun n]}
The return V
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.