-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicforLoops.py
More file actions
32 lines (28 loc) · 952 Bytes
/
BasicforLoops.py
File metadata and controls
32 lines (28 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# ***************************************************************
# Name : Basic for Loops
# Author: Than Tong
# Created : * Course: CIS189
# Version: 1.0
# OS: Windows 11
# IDE: Python
# Copyright : This is my own original work
# based onspecifications issued by our instructor
# Description :
# Input: ADD HERE XXX
# Ouput: ADD HERE XXX
# Academic Honesty: I attest that this is my original work.
# I have not used unauthorized source code, either modified or
# unmodified. I have not given other fellow student(s) access
# to my program.
"""
This script declares a list of floats, prints them in a for loop,
and prints the odd numbers descending from 99 to 33 in another for loop.
"""
# Declare a list of floats
floats = [1.1, 2.2, 3.3, 4.4, 5.5]
# Print each float in a for loop
for f in floats:
print(f)
# Print odd numbers descending from 99 to 33
for i in range(99, 32,-1):
print(i)