Python Learning record One

Source: Internet
Author: User

This is my first blog post.

I've been learning for 6 days since I learned the language of Python last week, and now I've been able to get started. During this time I encountered some problems, but also with the teacher learned a lot of knowledge.

The first problem is the problem of installing Python. Because most of the teacher's video is about the installation of Python on the Windows system, I've had a lot of problems installing on my Mac, but I finally got stuck and installed Python2 and Python3.

The second problem is the Python2 and python3 different problems. When the teacher spoke with print output, I followed the teacher to write code print ("My name is", name), but the results were somewhat different. The teacher prints: My name is Alex, and mine is: (' My name is ', ' Alex '). I watched for a long time did not find out exactly where the difference, and later on the Internet to find that the original version of the different, I use Python2, the teacher is Python3. With python2 words should be written: print "My name is", name. Hope that in the future when the teacher lectures more talk about some python2 and python3 differences.

After solving these two problems, there is no big problem behind the study, and this week learned knowledge has input,if else,while and for.

such as: (1) Username = input (username:)

Print (username)

(2) Age = 30

Guess = input (age:)

if age = = guess:

Print ("You Got It")

Else

Print ("Game over")

(3) Count = 0

Age = 30

While count<3:

Guess = input (age:)

if age = = guess:

Print ("You Got It")

Break

Elif age>guess:

Print ("Think bigger")

Else

Print ("Think smaller")

Else

Print ("Game over")

(4) For I in Range (10):

Print (i)

Python Learning record One

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.