Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

277 bytes added, 09:25, 21 January 2020
no edit summary
<font color='red'>
'''** DO NOT USE - TO BE UPDATED FOR CENTOS 8.0 **'''
</font>
= LAB OBJECTIVES =
== PART 1 - User Input ==
:In this section, you will learn how to prompt (ask) the user running the program python script for input or data. Although you will not be immediately be using the data that the user provided, you will use that data later in this lab to change how a Python script works in different situations.
'''Storing User Input data to Python objects'''
:# Write a Python script to prompt the user for a course mark (no error checking is required... you can assume that the input will be a valid mark from 0 to 100). Use an if-elif-else statement to convert the mark to a letter grade. For simplicity, you don't have to worry about D+, C+, B+, or A+
:# Write a Python script to print the text '''I love Python''' twenty times (on a separate line).
:# Identify and list the Python 3 keywords used in this lab.
:# Identify and list the Python 3 built-in functions used in this lab. (hint: the functions provided by the __builtins__ module)
:# '''INTERESTING CHALLENGE:''' Perform a Netsearch to see how you can write Python code to perform error-checking (using a loop) to force a user to enter a number for the shoe size script (created in question #2). There are two things to consider:<ol type="a"><li>A number as opposed to a string</li><li>It has to be an acceptable range from 1 to 20</li></ol>
[[Category:OPS435-Python]]
1,760
edits