python prg1

if関数

ーーーーーーーーーーーーーーーーーーーーーーーーーーーー

#!/usr/bin/env python3

a=3

b=10

c=a*b


if c>30:

    print(c)

    print('_c>30')

elif c<30:

    print(c)

    print('_c<30')

else:

    print('C=30')

ーーーーーーーーーーーーーーーーーーーーーーーーーーーー

for関数

ーーーーーーーーーーーーーーーーーーーーーーーーーーーー

for i in range(0, 5):

    #pass pass はヌル操作 (null operation) です — pass が実行されても、何も起きません。 pass は、構文法的には文が必要だが、コードとしては何も実行したくない場合のプレースホルダとして有用です。

    print(i,'テスト')

ーーーーーーーーーーーーーーーーーーーーーーーーーーーー


ブラウザ起動

ーーーーーーーーーーーーーーーーーーーーーーー

import webbrowser

import time


webbrowser.open('https://hibiki-press.tech/python/webbrowser_module/1884',0)

time.sleep(2)

webbrowser.open('https://docs.python.org/ja/3/library/intro.html#wasm-availability')

ーーーーーーーーーーーーーーーーーーーーーーー






コメント

このブログの人気の投稿

自動起動