小编Bra*_*ter的帖子

Python ImportError-这里有什么问题?

我是编程和Python的新手.我正在关注Learn Python the Hard Way一书.作为练习25的一部分,我写了一个脚本:

def break_words(stuff):   
    """This function will break up words for us."""   
    words = stuff.split(' ')    
    return words        

def sort_words(words):    
    """Sorts the words."""    
    return sorted(words)        

def print_first_word(words):    
    """Prints the first words after popping it off."""    
    word = words.pop(0)    
    print word

def print_last_word(words):    
    """Prints the last word after popping it off."""    
    word = words.pop(-1)    
    print word    

def sort_sentence(sentence):    
    """Takes in a full sentence and returns the sorted words."""    
    words = break_words(sentence)    
    return sort_words(words)       

def print_first_and_last(sentence):    
    """Prints …
Run Code Online (Sandbox Code Playgroud)

python import module importerror

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

import ×1

importerror ×1

module ×1

python ×1