Python Learning record One

Source: Internet
Author: User

#!/usr/bin/pytholn

#-*-Coding:utf-8-*-

Import Math

Import Sys


Def print_13 ():

#for I in range (10):

man_age = Int (raw_input (' Enter input age:\n '))

If Man_age >= and Man_age <= 12:

sex = str (raw_input (' Please input sex:m is the male or F a female and your are age: \ n '))

For I in range (10):

print ' Can join the team! '

print ' Thank for your cooperation '

#break

Else

Print "You is not satisfied"





Print print_13 ()


Def print_10 ():

n = Int (raw_input (' Enter number:\n '))

If n% 3 ==0 and n% 5 = = 0:

print ' N can be divisible by 3 or 5 '

Else

print ' N not being divisible by 3 or 5 '

#print_10 ()





Def print_price ():

Discount = 0

Pice = float (raw_input ("Please enter the purchase price:\n"))

If Pice >= and pice <= 100:

Discount = 0.1

print ' The discount price is 10. '

Elif pice > 100:

Discount = 0.2

print ' The discount price is 20%. '

Else

print ' Sorry! is not discount. '

Print Pice * Discount


#print_price ()





Def Print_huashi ():

Temperature = Float (raw_input ("Please input temperature: \ n"))

c = 5.0/9 * (temperature-3)

Print C


#print_huashi ()








Def print_sort ():

L = [0,2,3,4,5]

K = []

For I in L:

K.insert (0,i)

Print K


#print_sort ()




Def print_number ():

Str_num = ' 22222mmmm12232132312wqweqeqw '

result = 0

For I in Str_num:

If I in ' 0123456789 ':

Result + = 1

Print result


#print_number ()





Def print_50 ():

result = '

For I in Range (1,51,1):

if i = = 50:

result + = str (i)

Else

result + = str (i) + ""

Print result


#print_50 ()




Def list_print ():

Alist = [123, ' abc ', 4.56,[' inner ', ' list '],7-9j]


#print List_print ()




Def print_movices ():

Movices = ["The Holey Grail", "The Life of Brian", "The Meaning of life"]

Print Movices[1]


#print_movices ()







#比如abcd输出每一次减少一个字母输出

Def print_shusu ():

s = ' ABCDE '

i =-1

For I in range ( -1,-len (s),-1):

Print S[:i]

#print_shusu ()




Def print_three ():

L = []

For I in range (3):

x = Int (raw_input (' three number\n '))

L.append (x)

L.sort ()

Print L

#print_three ()


Print ("----------------")



#一个整数, it plus 100 is a complete square number, plus 268 is a complete square number, how much is the number

Def print_math ():

For I in range (100000):

x = Int (math.sqrt (i + 100))

y = Int (math.sqrt (i + 268))

if (x * x = = i + +) and (y * y = = i + 268):

Print I


#print_math ()


Print ("----------------")


#有四个数字: 1, 2, 3, 4, how many different and no repetition of the number of three digits? What's the number?


Def print_sort ():

For I in range (1,5):

For j in Range (1,5):

for k in range (1,5):

if (i! = k) and (I! = j) and (J!=k):

Print I, J, K


#print_sort ()


Python Learning record One

Related Article

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.