python circle nested
#!/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的更多相关文章
- 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 ...
- 可爱的 Python : Python中函数式编程,第一部分
英文原文:Charming Python: Functional programming in Python, Part 1 摘要:虽然人们总把Python当作过程化的,面向对象的语言,但是他实际上包 ...
- python 常用技巧 — 列表(list)
目录: 1. 嵌套列表对应位置元素相加 (add the corresponding elements of nested list) 2. 多个列表对应位置相加(add the correspond ...
- [Python]循环嵌套nested loop-练习题
[python的for循环嵌套打印如下图形] 图形一: ******* ******* ******* ******* 图形二: * *** ***** ******* 图形三: * *** **** ...
- Python For嵌套循环 图形打印X型 nested loop -练习题
For嵌套循环图形打印作业很多是C++语言做的,我觉得Python应该也能做,就来试一试. 原网址C++练习题:http://www.imooc.com/qadetail/216848?t=33880 ...
- 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 ...
- Python For嵌套循环 图形打印X型 nested loop - 练习题答案
上一篇:Python For嵌套循环 图形打印X型 nested loop - 练习题 上一篇留的Python For嵌套循环 图形打印X型练习题的答案. 由于网上很多嵌套循环都是C++语言写的,用P ...
- [Python] For 嵌套循环打印图形 nested loop-练习题答案
前一篇:[Python] For 嵌套循环打印图形 nested loop-练习题 [python的for循环嵌套打印如下图形] 图形一: 输出结果: ******* ******* ******* ...
- [Python] For 嵌套循环打印图形 nested loop - 练习题
[python的for循环嵌套打印如下图形] 图形一: ******* ******* ******* ******* 图形二: * *** ***** ******* 图形三: * *** **** ...
随机推荐
- 05_传智播客iOS视频教程_第一个OC程序
Cocoa Application开发的是带界面的程序. OC是完全兼容C语言的,但是C语言里面是不能写OC的东西的. OC和C的第一个区别,就是源文件的后缀名的区别.OC程序的源文件的后缀名是.m, ...
- 让padding不影响容器总长度
增加CSS属性: box-sizing:border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box;
- 使用FFMPEG从MP4封装中提取视频流到.264文件 (转载)
命令行: ffmpeg -i 20130312_133313.mp4 -codec copy -bsf: h264_mp4toannexb -f h264 20130312_133313.264 说明 ...
- BZOJ2006 超级钢琴
Description 给定一个长度为n的区间,询问前k大的区间和,区间长度\(\in [L, R]\). $ n, k <= 500000$ Solution 首先求前缀和.把一个区间 ...
- [poj2096] Collecting Bugs【概率dp 数学期望】
传送门:http://poj.org/problem?id=2096 题面很长,大意就是说,有n种bug,s种系统,每一个bug只能属于n中bug中的一种,也只能属于s种系统中的一种.一天能找一个bu ...
- PHP获取今天内的时间 今天开始和结束的时间戳
$t = time(); $start = mktime(0,0,0,date("m",$t),date("d",$t),date("Y", ...
- ACM_平面、空间分割问题(递推dp)
折线分割平面 Time Limit: 2000/1000ms (Java/Others) Problem Description: 我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要 ...
- Android 线程池系列教程(2)Thread,Runnable是基类及如何写Run方法
Specifying the Code to Run on a Thread 上一课 下一课 1.This lesson teaches you to Define a Class that Im ...
- 16-1 WEB存储基本操作
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- c#中stringbuilder的方法总结
String 对象是不可改变的.每次使用 System.String 类中的方法之一时,都要在内存中创建一个新的字符串对象,这就需要为该新对象分配新的空间.在需要对字符串执行重复修改的情况下,与创建新 ...