GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python Beginner tutorials. · cdsj/Source-Code-from-Tutorials@dbd5d86

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Python
    • 02_python.py
    • 03_python.py
    • 04_python.py
    • 05_python.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Python/02_python.py‎

Copy file name to clipboard
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
>>> 3 + 4
2+
7
3+
>>> 3 * 20
4+
60
5+
>>> 12 / 4
6+
3.0
7+
>>> 8 + 2 * 10
8+
28
9+
>>> (8 + 2) * 10
10+
100
11+
>>> 18 / 4
12+
4.5
13+
>>> 18//4
14+
4
15+
>>> 18%4
16+
2
17+
>>> 5 * 5 * 5
18+
125
19+
>>> 5 ** 3
20+
125
21+
>>> tuna = 5
22+
>>> 20 + tuna
23+
25
24+
>>> bacon = 18
25+
>>> bacon / tuna
26+
3.6
Collapse file

‎Python/03_python.py‎

Copy file name to clipboard
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
>>> Bucky Roberts
2+
SyntaxError: invalid syntax
3+
>>> "Bucky Roberts"
4+
'Bucky Roberts'
5+
>>> 'Bucky Roberts is awesome!'
6+
'Bucky Roberts is awesome!'
7+
>>> 'I don't think shes 18'
8+
SyntaxError: invalid syntax
9+
>>> "I don't think shes 18"
10+
"I don't think shes 18"
11+
>>> 'She said, "What part of the cow is the meatloaf from?" '
12+
'She said, "What part of the cow is the meatloaf from?" '
13+
>>> 'I don\'t think shes 18'
14+
"I don't think shes 18"
15+
>>> print("hey now brown cow")
16+
hey now brown cow
17+
>>> print('C:\Bucky\Desktop\nudePics')
18+
C:\Bucky\Desktop
19+
udePics
20+
>>> print(r'C:\Bucky\Desktop\nudePics')
21+
C:\Bucky\Desktop\nudePics
22+
>>> firstName = "Bucky "
23+
>>> firstName + "Roberts"
24+
'Bucky Roberts'
25+
>>> firstName + "McLovin"
26+
'Bucky McLovin'
27+
>>> firstName * 5
28+
'Bucky Bucky Bucky Bucky Bucky '
Collapse file

‎Python/04_python.py‎

Copy file name to clipboard
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
>>> user = "Tuna McFish"
2+
>>> user[0]
3+
'T'
4+
>>> user[5]
5+
'M'
6+
>>> user[-1]
7+
'h'
8+
>>> user[-3]
9+
'i'
10+
>>> user[2:7]
11+
'na Mc'
12+
>>> user[:7]
13+
'Tuna Mc'
14+
>>> user[2:]
15+
'na McFish'
16+
>>> user[:]
17+
'Tuna McFish'
18+
>>> print('dsadasd')
19+
dsadasd
20+
>>> len('dfjhf22893hfsdfjkasdf')
21+
21
22+
>>> len(user)
23+
11
Collapse file

‎Python/05_python.py‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
>>> players = [29, 58, 66, 71, 87]
2+
>>> players[2]
3+
66
4+
>>> players[2] = 68
5+
>>> players
6+
[29, 58, 68, 71, 87]
7+
>>> players + [90, 91, 98]
8+
[29, 58, 68, 71, 87, 90, 91, 98]
9+
>>> players
10+
[29, 58, 68, 71, 87]
11+
>>> players.append(120)
12+
>>> players
13+
[29, 58, 68, 71, 87, 120]
14+
>>> players[:2]
15+
[29, 58]
16+
>>> players[:2] = [0, 0]
17+
>>> players
18+
[0, 0, 68, 71, 87, 120]
19+
>>> players[:2] = []
20+
>>> players
21+
[68, 71, 87, 120]
22+
>>> players[:] = []
23+
>>> players
24+
[]

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.