raspberry pi 1 model b, python

Overview

I tried python with raspberry pi 1 model b.

Development environment

raspberry pi 1 model b raspbian 2016_09_23 jessie lite python 2.7.9

Sample code

# coding: utf-8
import random

zundoko = ["Dung", "Doco"]
n = 0
i = True
while (i):
    s = zundoko[random.randint(0, 1)]
    print (s)
    if (s == "Doco"):
        if (n == 4):
            print "Kiyoshi!"
            i = False
        else:
            n = 0
    else:        
        n = n + 1

Sample code

# coding: utf-8
def fizzbuzz(n):
    if n % 3 == 0 and n % 5 == 0:
        print("fizzbuzz")
        return 0
    if n % 3 == 0:
        print("fizz")
        return 1
    if n % 5 == 0:
        print("buzz")
        return 2
    print(n)    
    return 3
for i in range(100):
    fizzbuzz(i + 1)

Recommended Posts

raspberry pi 1 model b, python
raspberry pi 1 model b, node-red part 17
getrpimodel: Recognize Raspberry Pi model (A, B, B +, B2, B3, etc) with python
GPS tracking with Raspberry Pi 4B + BU-353S4 (Python)
Raspberry Pi 4B initial setting
Raspberry Pi + Python + OpenGL memo
USB boot with Raspberry Pi 4 Model B (3) LVM edition
Port FreeRTOS to Raspberry Pi 4B
Use vl53l0x with Raspberry Pi (python)
[Raspberry Pi] Changed Python default to Python3
Run BNO055 python sample code with I2C (Raspberry Pi 3B)
Detect "brightness" using python on Raspberry Pi 3!
Raspberry Pi Security Infrared Camera (Python Edition)
Raspberry Pi backup
Run servomotor on Raspberry Pi 3 using python
Build OpenCV-Python environment on Raspberry Pi B +
Infer Custom Vision model with Raspberry Pi
Detect temperature using python on Raspberry Pi 3!
Working with GPS on Raspberry Pi 3 Python
Discord bot with python raspberry pi zero with [Notes]
Why detectMultiScale () is slow on Raspberry Pi B +
Detect slide switches using python on Raspberry Pi 3!
[Amateur remarks] Raspberry Pi 3, Wordpress vs Raspberry Pi 3, python, Django
How to use Raspberry Pi pie camera Python
I tried L-Chika with Raspberry Pi 4 (Python edition)
Detect magnet switches using python on Raspberry Pi 3!
Get CPU information of Raspberry Pi with Python
Make DHT11 available on Raspberry Pi + python (memo)
Sound the buzzer using python on Raspberry Pi 3!
Serial communication between Raspberry pi --Arduino Uno (Python)
Introduced Ceph on Kubernetes on Raspberry Pi 4B (ARM64)
Connect to MySQL with Python on Raspberry Pi
Build a Python development environment on Raspberry Pi
Measure CPU temperature of Raspberry Pi with Python
What is Raspberry Pi?
GPGPU with Raspberry Pi
pigpio on Raspberry pi
Raspberry Pi video camera
I tried running Flask on Raspberry Pi 3 Model B + using Nginx and uWSGI
Raspberry Pi Bad Knowledge
DigitalSignage with Raspberry Pi
Raspberry Pi 4 setup memo
Cython on Raspberry Pi
Python3> round (a --b, 7)
Raspberry Pi system monitoring
From setting up Raspberry Pi to installing Python environment
Run LEDmatrix interactively with Raspberry Pi 3B + on Slackbot
How to use the Raspberry Pi relay module Python
Try debugging Python on Raspberry Pi with Visual Studio.
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
Install pyenv on Raspberry Pi and version control Python
Output to "7-segment LED" using python on Raspberry Pi 3!
Display USB camera video with Python OpenCV with Raspberry Pi
Let's operate GPIO of Raspberry Pi with Python CGI
Raspberry Pi with Elixir, which is cooler than Python
Introduced python3-OpenCV3 to Raspberry Pi
Indoor monitoring using Raspberry Pi
VScode intellisense doesn't work on Raspberry Pi OS 64bit! (Python)
Mutter plants with Raspberry Pi
Update Python for Raspberry Pi to 3.7 or later with pyenv
Run AWS IoT Device SDK for Python on Raspberry Pi