机器之心报道
参与:思
这是一份极简的 Python 入门课程,推出 11 天以来,目前已经有 54.6 万的播放量。它从最基础的知识点出发,是难得的入门好课程。
Python 课程目前已经有非常多的资源,视频教程也非常多。如果读者想要学习 Python,找一本书籍、看一些视频、做一些小项目,那么你就能掌握 Python 的各种开发技巧了。但这个过程需要很多努力,会有比较高的学习成本。
课程地址:https://channel9.msdn.com/Series/Intro-to-Python-Development
代码地址:https://github.com/microsoft/c9-python-getting-started
# Create a function to return the first initial of a name
# Parameters:
# name: name of person
# force_uppercase: indicates if you always want the initial to be in upppercase
# Return value
# first letter of name passed in
def get_initial(name, force_uppercase):
if force_uppercase:
initial = name[0:1].upper()
else:
initial = name[0:1]
return initial
# Ask for someone's name and return the initial
first_name = input('Enter your first name: ')
# Call get_initial to retrieve first letter of name
# When you use named notation, you can specify parameters in any order
first_name_initial = get_initial(force_uppercase=True, \
name=first_name)
print('Your initial is: ' + first_name_initial)