#!/usr/bin/python
# -*- coding:utf- -*- # @filename: tmp2
# @author:vickey
# @date: // : def circle_nested(total, inside):
for i in range(, total + ): if i > inside: # i =
j = i - inside * ((i - ) / inside)
print(i, j)
else:
print(i, i) circle_nested(, )

效果:

(1, 1)
(2, 2)
(3, 3)
(4, 1)
(5, 2)
(6, 3)
(7, 1)
(8, 2)
(9, 3)
(10, 1)
(11, 2)
(12, 3)
(13, 1)

python circle nested的更多相关文章

  1. Default Parameter Values in Python

    Python’s handling of default parameter values is one of a few things that tends to trip up most new ...

  2. 可爱的 Python : Python中函数式编程,第一部分

    英文原文:Charming Python: Functional programming in Python, Part 1 摘要:虽然人们总把Python当作过程化的,面向对象的语言,但是他实际上包 ...

  3. python 常用技巧 — 列表(list)

    目录: 1. 嵌套列表对应位置元素相加 (add the corresponding elements of nested list) 2. 多个列表对应位置相加(add the correspond ...

  4. [Python]循环嵌套nested loop-练习题

    [python的for循环嵌套打印如下图形] 图形一: ******* ******* ******* ******* 图形二: * *** ***** ******* 图形三: * *** **** ...

  5. Python For嵌套循环 图形打印X型 nested loop -练习题

    For嵌套循环图形打印作业很多是C++语言做的,我觉得Python应该也能做,就来试一试. 原网址C++练习题:http://www.imooc.com/qadetail/216848?t=33880 ...

  6. Calling Matlab function from python: “initializer must be a rectangular nested sequence”

    I am writing a python script from which I hope to call the Matlab anovan function. I have attempted ...

  7. Python For嵌套循环 图形打印X型 nested loop - 练习题答案

    上一篇:Python For嵌套循环 图形打印X型 nested loop - 练习题 上一篇留的Python For嵌套循环 图形打印X型练习题的答案. 由于网上很多嵌套循环都是C++语言写的,用P ...

  8. [Python] For 嵌套循环打印图形 nested loop-练习题答案

    前一篇:[Python] For 嵌套循环打印图形 nested loop-练习题 [python的for循环嵌套打印如下图形] 图形一: 输出结果: ******* ******* ******* ...

  9. [Python] For 嵌套循环打印图形 nested loop - 练习题

    [python的for循环嵌套打印如下图形] 图形一: ******* ******* ******* ******* 图形二: * *** ***** ******* 图形三: * *** **** ...

随机推荐

  1. AutoIT: FileReadLine可以对文件进行读行操作

    $fHandle= ) Then $line= FileReadLine($fHandle) Then ExitLoop Wend EndIf FileClose($fHandle)

  2. Oracle “CONNECT BY” 用法

    Oracle “CONNECT BY”是层次查询子句,一般用于树状或者层次结果集的查询.其语法是: [ START WITH condition ] CONNECT BY [ NOCYCLE ] co ...

  3. WinPcap笔记2之获取已经安装设备的高级信息

    1 主要数据结构定义 struct pcap_if//网络接口列表的一个节点 一个网络接口就是一个结点 方便链表    {        struct pcap_if *next;//网络接口节点   ...

  4. Java位运算(移位,位与,或,异或,非)

    1.左移( << ) // 0000 0000 0000 0000 0000 0000 0000 0101 然后左移2位后,低位补0:// // 0000 0000 0000 0000 0 ...

  5. ubuntu下为thunderbird添加邮件提醒功能(转载)

    转自:http://blog.csdn.net/zhangt85/article/details/9154525 1.“工具”-->“附件组件” 2.搜索“new_mail_attention” ...

  6. Linux 系统管理命令 - vmstat - 虚拟内存统计

    命令详解 重要星级: ★★★★☆ 功能说明: vmstat 是 Virtual Memory Statistics ( 虚拟内存统计 ) 的缩写,利用 vmstat 命令可以对操作系统的内存信息.进程 ...

  7. 第四篇(那些JAVA程序BUG中的常见单词)

    xxx cannot be resolved to a variable xxx无法解析为变量 resolve 解析

  8. Miller&&Pollard HDOJ 4344 Mark the Rope

    题目传送门 题意:一个长为n(n<2^63)的管子,在管子上做标记,每隔L个长度单位做一个标记,从管子头端开始,保证最后一次标记恰好在管子的尾端.让你找出有多少个这样的L(L<n),且他们 ...

  9. 题解报告:hdu1202The calculation of GPA(算绩点问题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1202 Problem Description 每学期的期末,大家都会忙于计算自己的平均成绩,这个成绩对 ...

  10. 题解报告:hdu 1060 Leftmost Digit

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1060 问题描述 给定一个正整数N,你应该输出N ^ N的最左边的数字. 输入 输入包含多个测试用例. ...