On Tuesday, April 5, 2016 at 12:53:13 PM UTC+5:30, Gordon( Hotmail ) wrote: > I am struggling to understand the basic principles of Python having spent > many years as a pure Amateur tinkering with a variety of BASIC as you can > see on my site at http://www.sigord.co.uk/ I think you will agree all such > versions of Basic I have used are far easier to understand than Python. > Though with my limited knowledge I accept Python may have many advantages > over say Liberty Basic etc. > > The problem I am finding is most of the sites claiming to help understand > Python devote far too much space bragging about the wonders of Python instead > of concentrating how to make sensible use of it. For example I struggle to > find examples of such as below if you could please help me. If I manage to > duplicate some of my efforts on my site with Python I will be happy to upload > the code to my site. I will also try to upload working exec files of such > also, except my previous attempts at downloading the relevant software was > blocked by AVG software as risky. > > Gordon > > > Liberty Basic > for n = 32 to 255: print n;chr$(n) : next n
I grew up on BBC basic in 1984. Not used thereafter. Your first one is (I guess) this in python: >>> for i in range(32,127): ... print chr(i), ... ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ > > REM BBC Basic > FOR c = 1 TO 15 : COLOUR c > PRINT "Color ";c > NEXT c > > REM BBC Basic > c = 0 > FOR x = 80 TO 2000 STEP 96 > GCOL c: CIRCLE FILL x,500,50 : c = c + 1 > NEXT x If you tell us some more of what color, gcol etc do someone will likely show you Though in all fairness I dont expect it to be as pithy as the BASIC -- https://mail.python.org/mailman/listinfo/python-list