-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6_8_exercise-loop-task.py
More file actions
87 lines (64 loc) · 1.55 KB
/
Copy path6_8_exercise-loop-task.py
File metadata and controls
87 lines (64 loc) · 1.55 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 20 08:50:32 2019
@author: Giles
"""
'''
Question 1
Ask the user for two numbers between 1 and 100. Then count from the
lower number to the higher number. Print the results to the screen.
'''
'''
Question 2
Ask the user to input a string and then print it out to the screen in
reverse order (use a for loop).
'''
'''
Question 3
Ask the user for a number between 1 and 12 and then display a times
table for that number.
'''
'''
Question 4
Can you amend the solution to question 3 so that it just prints out all
times tables between 1 and 12? (no need to ask user for input)
'''
'''
Question 5
Ask the user to input a sequence of numbers. Then calculate the mean
and print the result
'''
'''
Question 6
Write code that will calculate 15 factorial. (factorial is product of
positive ints up to a given number. e.g 5 factorial is 5x4x3x2x1)
'''
'''
Question 7
Write code to calculate Fibonacci numbers. Create list containing
first 20 Fibonacci numbers, (Fib numbers made by sum of preceeding
two. Series starts 0 1 1 2 3 5 8 13 ....)
'''
'''
Question 8
The previous question was the first to contain comments. Go back
through the other questions in this file and add comments to the
solutions.
'''
'''
Question 9
*****
*
****
*
*
*
Can you draw this using python? (comment the solution code)
'''
'''
Question 10
Write some code that will determine all odd and even numbers
between 1 and 100. Put the odds in a list named odd and the evens
in a list named even.
'''