首页 > 编程语言 >python生信01

python生信01

时间:2023-09-28 20:56:14浏览次数:39  
标签:test1 01 pc1 python py range test root 生信

 

001、生成

nN

nnNN

nnnNNN

....

a、

[root@pc1 test1]# ls
test.py
[root@pc1 test1]# cat test.py        ## 测试程序
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

for i in range(1,11):
        for j in range(1,i):
                print("n", end = "")
        for k in range(1,i):
                print("N", end = "")
        print("")
[root@pc1 test1]# python3 test.py     ## 执行程序

nN
nnNN
nnnNNN
nnnnNNNN
nnnnnNNNNN
nnnnnnNNNNNN
nnnnnnnNNNNNNN
nnnnnnnnNNNNNNNN
nnnnnnnnnNNNNNNNNN

 

b、

[root@pc1 test1]# ls
test.py
[root@pc1 test1]# cat test.py            ### 程序
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
for i in range(1,10):
        k = 1
        while k <= i:
                print("n", end = "")
                k += 1
        k= 1
        while k <=i:
                print("N", end = "")
                k += 1
        print("")
[root@pc1 test1]# python3 test.py         ## 运行程序
nN
nnNN
nnnNNN
nnnnNNNN
nnnnnNNNNN
nnnnnnNNNNNN
nnnnnnnNNNNNNN
nnnnnnnnNNNNNNNN
nnnnnnnnnNNNNNNNNN

 

002、

 

标签:test1,01,pc1,python,py,range,test,root,生信
From: https://www.cnblogs.com/liujiaxin2018/p/17736473.html

相关文章

  • 【闲暇一写】用Python编写2048游戏(命令行版)
    本篇博文围绕使用Python开发热门游戏2048GAME(命令行版本)代码未做任何优化(原生且随意)、全程以面向过程、MVC的设计思想为主、开发环境是Ubuntu系统下的Pycharm2048是我很久以前学习Python过程中的一个作业,接下来直入正题——一、了解游戏1.介绍《2048》是一款单人在线和移......
  • python中实现数字的全排列
     001、假定数字为3[root@pc1test1]#lstest.py[root@pc1test1]#cattest.py##测试程序#!/usr/bin/envpython3#-*-coding:utf-8-*-foriinrange(1,4):forjinrange(1,4):ifj==i:continue......
  • 【闲暇一写】用Python编写2048游戏(命令行版)
    本篇博文围绕使用Python开发热门游戏2048GAME(命令行版本)代码未做任何优化(原生且随意)、全程以面向过程、MVC的设计思想为主、开发环境是Ubuntu系统下的Pycharm2048是我很久前学习Python过程中的一个作业,直入正题——一、了解游戏1.介绍《2048》是一款单人在线和移动端游戏......
  • P5020 [NOIP2018 提高组] 货币系统
    #include<cstdio>#include<algorithm>usingnamespacestd;constintN=105;constintA=25005;inta[N];booldp[A];intmain(){ intt;scanf("%d",&t); while(t--){ intn;scanf("%d",&n); for(inti=......
  • P1941 [NOIP2014 提高组] 飞扬的小鸟
    #include<cstdio>#include<algorithm>usingnamespacestd;constintN=10005;constintM=1005;constintINF=1e9;intup[N],down[N],low[N],high[N],dp[2][M];boolpipe[N];intmain(){ intn,m,k; scanf("%d%d%d",&n......
  • AT_agc019_b 题解
    洛谷链接&Atcoder链接。题目简述给定一个字符串\(A\),可以选择区间\([i,j]\)翻转一次,求能得到多少本质不同的字符串。(\(A\)的长度不超过\(2\times10^5\))。思路首先解释本质不同的含义,即不完全相等的两个字符串(可能\(A\)是\(B\)的字串)。如果想直接求得答案显然是不......
  • RES.6-013 AI 101
    目录WhatisAI?ThemaintakeawayDeeplearningThetypeofAIGeneralAINarrowAIHowtobuildAIExpertsystemsTreesearchThetasksofMachinelearningClassificationClusteringRegressionTypesoflearningSupervisedUnsupervisedReinforcementlearningThesevensteps......
  • 零基础Python经验体验代码检查工具
    作者:yd_257945187原文链接:<https://bbs.huaweicloud.com/blogs/411648>1 开发小白自述年初,我开始从java语言转战Python语言的开发,对于零基础python经验的人来说,要开发出高质量且安全性能高的Python代码最好的方式莫过于使用代码检查工具辅助了。它们不仅能使工作更加简单、还能够......
  • Python实现网络爬虫
    一、网络爬虫的定义网络爬虫,即WebSpider,是一个很形象的名字。把互联网比喻成一个蜘蛛网,那么Spider就是在网上爬来爬去的蜘蛛。网络蜘蛛是通过网页的链接地址来寻找网页的。从网站某一个页面(通常是首页)开始,读取网页的内容,找到在网页中的其它链接地址,然后通过这些链接地址寻找下一......
  • Python 合并Excel文件(Excel文件多sheet)
    一、Python合并Excel文件多sheet《方法1》importosimportpandasaspd#指定包含Excel文件的文件夹路径folder_path='C:\\Users\\Admin\\Desktop\\数据核对'#获取文件夹中的所有Excel文件excel_files=[fileforfileinos.listdir(folder_path)iffile.endswith......