Python3 (b) simple input and output and built-in function view

Source: Internet
Author: User

After working with a girlfriend to learn Python3, code is she knocked, a little spicy eyes, only for reference.

1. Title: Enter "name", output "Hello, name"

For instructions on installing and opening the Python shell, refer to this: http://www.jb51.net/article/129327.htm

Steps:

File>new file Enter the following code

Python3 Code:

Name = Input ("Enter your Name:") print ("Hello,", name)

Results:

2. Play a word game and guess the height.

Python3 Code:

Print ("......") I love Willie ... ') tall = input ("You know how Tall Willie is:")  guess = Int (tall)       #将tall强制转型赋值给guessif guess = = 190:       #判断 Print ("Your sister, it all knows!") ") Print (" bingo!! Guess right, you're awesome! Else:print ("Really stupid, don't want to play with you, Goodbye.") ") Print (" Granville is the best!!! ")

Results:

3. Built-in functions

Python3 view statements for built-in functions:

Dir (__builtins__)

If you want to know the specific function and usage description of a function, say int, use the following statement:

Help (int)  #help加内置函数名称, you can find out the function and usage.

Original link: http://www.jb51.net/article/129453.htm

Python3 (b) simple input and output and built-in function view

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.