Giter Site home page Giter Site logo

akuli / python-tutorial Goto Github PK

View Code? Open in Web Editor NEW
1.3K 77.0 586.0 2.13 MB

A Python 3 programming tutorial for beginners.

License: Other

Python 99.02% CSS 0.98%
tutorial tutorials python python-3 python-tutorial beginner-friendly beginner learn-to-code learning-python oop

python-tutorial's Introduction

Python programming tutorial for beginners

This is a concise Python 3 programming tutorial for people who think that reading is boring. I try to show everything with simple code examples; there are no long and complicated explanations with fancy words. If you have never programmed before click here to find out what programming is like and get started.

This tutorial is aimed at people with no programming experience at all or very little programming experience. If you have programmed a lot in the past using some other language you may want to read the official tutorial instead.

You can use Python 3.6 or any newer Python with this tutorial. Don't use Python 2 because it's no longer supported.

List of contents

The tutorial consists of two sections:

Basics

This section will get you started with using Python and you'll be able to learn more about whatever you want after studying it.

  1. What is programming?
  2. Installing Python
  3. Getting started with Python
  4. ThinkPython: The way of the program
  5. Variables, Booleans and None
  6. Using functions
  7. Setting up an editor
  8. If, else and elif
  9. Handy stuff with strings
  10. Lists and tuples
  11. Loops
  12. zip and enumerate
  13. Dictionaries
  14. Defining functions
  15. Writing a larger program
  16. What is true?
  17. Files
  18. Modules
  19. Exceptions
  20. Classes
  21. Docstrings

Advanced

If you want to learn more advanced techniques, you can also read this section. Most of the techniques explained here are great when you're working on a large project, and your code would be really repetitive without these things.

You can experiment with these things freely, but please don't use these techniques just because you know how to use them. Prefer the simple techniques from the Basics part instead when possible. Simple is better than complex.

  1. Handy data types
  2. Advanced stuff with functions
  3. Magic methods
  4. Iterables, iterators and generators

Other things this tutorial comes with

Frequently asked questions

How can I thank you for writing and sharing this tutorial?

You can star this tutorial. Starring is free for you, but it tells me and other people that you like this tutorial.

Go here if you aren't here already and click the "Star" button in the top right corner. You will be asked to create a GitHub account if you don't already have one.

How can I read this tutorial without an Internet connection?

  1. Go here if you aren't here already.

  2. Click the big green "Clone or download" button in the top right of the page, then click "Download ZIP".

    Download ZIP

  3. Extract the ZIP and open it. Unfortunately I don't have any more specific instructions because how exactly this is done depends on which operating system you run.

  4. Run make-html.py and follow the instructions.

If you have git and you know how to use it, you can also clone the repository instead of downloading a zip and extracting it. An advantage with doing it this way is that you don't need to download the whole tutorial again to get the latest version of it, all you need to do is to pull with git and run make-html.py again.

Authors

I'm Akuli and I have written most of this tutorial, but other people have helped me with it. See github's contributors page for details.


If you have trouble with this tutorial, please tell me about it and I'll make this tutorial better, or ask for help online. If you like this tutorial, please give it a star.

You may use this tutorial freely at your own risk. See LICENSE.

List of contents

python-tutorial's People

Contributors

akuli avatar anjali4rl avatar damianherfkens avatar debdutgoswami avatar georgerahul24 avatar muninnhugin avatar sam4u3 avatar sarvesh4396 avatar spiritualforest avatar tusharkhatriofficial avatar varian97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-tutorial's Issues

Add Some OOP-related Contents to the List

That's really a good tutorial to start with. After learning some of the basics of Python, however, classes seem to be a quite sophisticated topic. Do you think it would be better to add more conceptual stuff built on classes, like inheritance or polymorphism, etc?

AttributeError

class TutorialRenderer(mistune.Renderer):
AttributeError: module 'mistune' has no attribute 'Renderer'

please resolve this problem.

Iterating the iterated list in python

first = []
second = []
for i in range(len(fruits)):
first.append(fruits[i])
#after this method i am getting the output like below
["orange", "apple", "banana"]
for item in range(len(first)):
print(first[item])
# after this method i am getting the output like this
orange
apple
banana
#i am trying to store the above values inside the second=[]
Need an solution for this

One little obstacle

Hello Akuli

I am doing the exercise for if else/elif

print('Hello!')
something = input("Enter something: ")
if something = 'hello':
print("Hello for you too!")

elif something = 'hi'
print('Hi there!')
else:
print("I don't know what," something, "means.")

I ve fixed the errors in the block, but having trouble to fix the last else-print-clause, when i run it, no results, and no error message, it stuck. Please help.

btw, wonderful tutorial.

Thanks much

Tony

spelling error

in your dictionary file you said 'cats and docs' when you clearly meant to say 'cats and dogs'

its under the example which is under the Header: "What are Dictionaries?"

GREAT TUTORIAL

its a simple and great tutorial.

my request is you can make it complex by explaining each topic of the contents of the "official python document", in simple term with examples

CONFUSED

I BEGAN YOUR "BASIC' TUTORIAL AND WORKED UP TO EDITOR. YOU SUGGESTED PORCUPINE AND MENTIONED SOME NEW TERMS LIKE TERMINAL; AND SAID IF YOU DON'T UNDERSTAND THESE TERMS, CLICK HERE AND THEN I GOT COMPLETELY LOST.

PS. I am a retired chemistry professor and learning to code as a way to interact with my very smart 15 yr old grandson. And keep my brain active. It has been long time since I used Fortran.

attributeError

class TutorialRenderer(mistune.Renderer):
AttributeError: module 'mistune' has no attribute 'Renderer'

please resolve this problem

restructure the tutorial to fit todays learning needs!

Hi! I would like to work on restructuring this tutorial so that it fits latest learning requirements... With ur guidance I would be able to work on something that will contribute to this repo, learners of this repo and me personally. Please do let me know if you are planning to restructure it any time soon.

dict.get() example needs clarification

<Arrinao> sentence = input("Enter a sentence: ")
<Arrinao> counts = {}
<Arrinao> for word in sentence.split():
<Arrinao>     counts[word] = counts.get(word, 0) + 1
<Akuli> two cases: word is not in counts, word is in counts
<Akuli> word not in counts:   counts[word] = 0+1
<Akuli> s o when we see it for the first time, set count to 1
<Akuli> and when word is in counts, it does:   counts[word] = counts[word] + 1
<Akuli> so when we see a word we already saw before, we increment the count

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.