best way to learn python for non programmer

Want to know best way to learn python for non programmer? we have a huge selection of best way to learn python for non programmer information on alibabacloud.com

Stupid way to learn Python (40)

;>Next we have to do an exercise, you must be very careful, I ask you to write down this exercise, and then try to understand what it does. This exercise is very interesting, you may have the feeling of being enlightened when you finish it.1Cities = {'CA':'San Francisco','MI':'Detroit',2 'FL':'Jacksonville'}3 4cities['NY'] ='New York'5cities['OR'] ='Portland'6 7 def find_city (Themap, State):8 ifState in Themap:9 return Themap[state]Ten Else: OneReturn"Not found." A

Exercise 5: More variables and printing | Stupid way to learn Python

notation reserved 2 decimal places>> 1.29e+00Formatting operator Auxiliary directivesSymbolic effect* Define width or decimal point accuracy-Used for left alignment+ Show plus sign (+) in front of positive number# 0 (' 0 ') is displayed in front of the octal number, preceded by ' 0x ' or ' 0X ' in hexadecimal (depending onUsing ' x ' or ' x ')0 The number shown is preceded by ' 0 ' instead of the default space% ' percent ' output a single '% '(VAR) mapping variable (dictionary parameter)M.N m i

Learn Python the hard way--exercise 46

0. Origins"Learn Python the hard" Exercise 46 requires four Python package pip, distribute, Nose, Virtualenv, (original book author Special reminder: do not just D Onwload these packages and install them by hand. Instead See how other people recommend you install these packages and use them for your particular system.) to complete the exercise. 0.1 Learning Goals

The way to Big data processing (10 minutes to learn Python)

of the "Python is the glue language, using Python to quickly generate a prototype of the program (and sometimes even the final interface of the program), and then to the special requirements of the part, with a more appropriateof the language Rewriting, than such as the Graphics rendering module in 3D games, performance requirements are particularly high, can be rewritten in C + +. "(3) share a very basic

Stupid way to learn Python (37)

Exercise 37: Reviewing various symbolsIt's time to review your learned symbols and Python keywords, and you'll learn something new in this section. What I'm doing here is a list of all the Python symbols and keywords that are worth mastering.In this lesson, you need to review every keyword, remember its role and write it down, and then search the Web for its true

Learn Python The Hard Way learning (18)-naming, variables, code, functions

Is the title long? I am introducing you to functions. Every programmer has different opinions, but now I will only teach you the simplest usage. Functions do three things:They name the code, just like assigning a variable name to strings and numbers.They receive parameters, just like argv in the script.Use articles 1 and 2 to implement your own mini scripts or small methods.If you use def to create a function, four functions are created and the relati

Stupid way to learn Python (28)

being, it always comes when you understand.The results you should seeThe following is the result of a conversation with python after you have guessed the result yourself:$ pythonpython 2.5.1 (r251:54863, Feb 6, 19:02:12)[GCC 4.0.1 (Apple Inc. build 5465)] on DarwinType " Help "," copyright "," credits "or" license "for more information. True true2TrueBonus points Exercise Python also has many

Learn Python The Hard Way learning (35)-branches and functions

honey.The fat bear is in front if another door.How are you going to move the bear?> Taunt bearThe bear has moved from the door. you can go through it now.> Taunt bearI got no idea what that means.> Open doorThis room is full of fold. How much do you take?> 4Man, learn to type a number. Good job!Root @ he-desktop :~ /Mystuff # python ex35.pyYou are in a dark room.There is a door to your right and left.Which

Stupid way to learn Python (38)

explain the meaning of the code to yourself through annotations. Explain how each function is used, the purpose of each variable, and any other aspect of the content, as long as it helps you to understand the code.Finally, each part of the code that is difficult to track, line-by-row or function-by-bit tracking variable values. You can print one more copy and write the value of each variable you want to "track" in the blanks.Once you have a basic understanding of the function of the code, go ba

Learn Python The Hard Way learning (5)-more variables and Printing

Now we enter more variables and print them. We usually use "" to refer to strings. Strings are quite convenient. In practice, we will learn how to create strings containing variables. There is a special way to insert a variable into a string, which is equivalent to telling Python: "Hey, this is a formatted string. Put the variable here ." Enter the following prog

Stupid way to learn Python (2)

done."Out_file.close ()In_file.close ()#另一种写法 (only one line):From sys import ARGVScript,from_file,to_file = argvOpen (To_file, ' W '). Write (open (from_file). Read ())Exercise: naming, variables, code, functionsWhat are the rules for function names?As with the variable name, it can be as long as it consists of alphanumeric and underscore, and not the number beginning.What does it mean to be *args *?Its function is to tell Python to accept all the p

Learn the basics of Python-data structures, algorithms, design patterns---one-way lists

It seems that the following is the most elegant implementation.Other, either node redundancy, or initialize ugly ...#!/usr/bin/env python#-*-coding:utf-8-*-classNode:def __init__(self, initdata): Self.__data=InitData self.__next=NonedefGetData (self):returnSelf.__data defGetNext (self):returnSelf.__next defSetData (Self, newdata): Self.__data=NewDatadefSetnext (Self, newnext): Self.__next=Newnextclasssincyclinkedlist:def __init__(self): Self.head=No

Lpthw stupid way to learn Python chapter 33

The 32-33 chapters will be for-loop and while-loop loops.The two kinds of syntax will not be said. Simply say the individual's understanding for and while.I think he learn python.First say the same point:1, can not do a single operation, For-loop if the collection is empty, the condition behind the while is false he can also do a loop operation is not done, the test method is as follows:   for inch []: Print " 1 " , I,     While I : Print 1

Stupid way to learn Python (16)

line, and clarify your ideas for yourself. Even if you can't clear your mind, you can also know exactly where you really didn't understand. Write a script similar to the one in the previous exercise and read the file you just created, using Read and argv . There are too many places to repeat in the file. Try to print line1, line2, line3 with a target.write () , you can use strings, format characters, and escape characters. Find out why we need to give open multiple a ' W ' paramete

Stupid way to learn Python (31)

!" - Else: - Print "Well , doing%s is probably better. Bear runs away."% Bear - + elifDoor = ="2": - Print "You stare to the endless Abyss at Cthulhu ' s retina." + Print "1. Blueberries." A Print "2. Yellow jacket clothespins." at Print "3. Understanding revolvers yelling melodies." - -Insanity = Raw_input (">") - - ifInsanity = ="1" orInsanity = ="2": - Print "Your body survives powered by a mind of Jello. Good job!" in Else: - Print "The

Lpthw stupid way to learn Python 40 Chapter Class

Today read the 40th chapter of LPTHW after the enlightened, the original has been dull, do not understand the definition and use of the class, there is not quite understand the definition of self.class MyStuff (object): def __init__ "and nowa thousand years between"def Apple: print "I AM classy apples! "  Say the class and the Mini module is similar, then for the class, there must be an import-like concept. The concept name is "instance (instance)". This is just a acting knowledgeable, it

Stupid way to learn python (29)

? What happens if you don't indent? Is it possible to put the other Boolean expressions in Exercise 27 in the "if statement"? Try it. What happens if I change the initial value of the variable people, Cats, and dogs ? Exercise Exercises1.The IF statement.if sentence1: sentence2The sentence one is the judgment part , of course, it can also be a Boolean expression of the previous lesson.The white space in front of the statement two is also part of the IF statement, and using i

Stupid way to learn Python exercise 42 plus points exercise

":Return ' death 'elif action = = "Slowly Place the bomb":Return ' Escape_pod 'ElseReturn ' The_bridge 'def escape_pod (self):Good_pod = Randint (1,5)Guess = Raw_input ("[Pod #]>>>")if int (guess)! = good_pod:Return ' death 'ElseExit (0)Class Engine (MAP):def __init__ (Self,start):Self.start = Startdef play (self):Next = Self.startWhile True:print "\ n-----------"GetAttr (Self,next)Next = Guest ()A_game = Engine ("Central_corridor")A_game.play () Remark: Beginner young novice, Welcome to the gre

Learn Python The Hard Way learning (13)-parameters, unpacking, variables

In the following example, we will pass a variable to the script. Do you know why you enter python ex13.py to execute the ex13.py file? The command "ex13.py" is actually a "parameter". Let's write a script that can accept parameters.[Python]1. from sys import argv2.3.4. script, first, second, third = argv5.6.7. print "The script is called:", script8. print "Your first variable is:", first9. print "Your secon

As a non-computer graduate who wants to learn the R language, is it best to start from python?

The direction is data analysis, partial statistics, and network analysis. Reply content: as a programmer who has been working for ten years, we recommend that you do not want to learn what you want. Once you have this idea, you are done. N people will advise you: do you want to learn computer basics? How can I learn pr

Total Pages: 5 1 2 3 4 5 Go to: Go

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.