0% found this document useful (0 votes)
27 views7 pages

Challenges 51

The document contains code snippets demonstrating the use of random numbers, lists, strings, and the turtle module in Python. It includes examples of generating random numbers, choosing random elements from lists, basic string manipulation, and using turtle graphics to draw shapes.

Uploaded by

qweerty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views7 pages

Challenges 51

The document contains code snippets demonstrating the use of random numbers, lists, strings, and the turtle module in Python. It includes examples of generating random numbers, choosing random elements from lists, basic string manipulation, and using turtle graphics to draw shapes.

Uploaded by

qweerty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

#num =10

#while num >0:


# print("there are",num,"green bottles hanging on the wall",num,"green bottles
hanging on the wall and if 1 green bottle should accidentaly fall")
# answer = int(input("how many green bottles will be hanging on the wall?"))
# while answer != num:
# num = num-1
# print("No, try again")
# num = int(input("how many green bottles will be hanging on the wall?"))
#print("there are no more green bottles hanging on the wall")

#import random
#num = random.randint(0,100)
#print(num)

#import random
#fruit = random.choice(["apple","banana","pear"])
#print(fruit)

#import random
#coin = random.choice(["heads","tails"])
#user = input("heads or tails")
#
#if coin == user:
# print("correct")
#else:
# print("bad luck")

#import random
#num = random.choice([1,2,3,4,5])
#user = int(input("enter a num 1-5"))
#
#if num == user:
# print("well done")
#else:
# if num > user:
# print("too low")
# else:
# print("too high")
# user = int(input("enter a num 1-5"))
# if num == user:
# print("correct")
# else:
# print("you lose")

#import random
#num = random.randint(0,10)
#user = int(input("what num"))
#while num != user:
# if num > user:
# print("too low")
# else:
# print("too high")
# user = int(input("what num"))

#import random
#points =0
#for i in range (0,6,1):
# num1 = random.randint(0,10)
# num2 = random.randint(0,10)
# print(num1,num2)
# total = num1 + num2
# answer = int(input("what is the total of those numbers"))
# if total == answer:
# points= points + 1
# else:
# points = points
#print("you got",points,"points")

#import random
#colours =["red","blue","green","orange","black"]
#colour = random.choice(colours)
#def clues(choice,colour):
# if choice =="red":
# clue =colour
# elif choice =="blue":
# clue =colour
# elif choice =="green":
# clue =colour
# elif choice =="orange":
# clue =colour
# else:
# clue =colour
# return clue
#print(colours)
#choice = input("pick a colour from the list")
#if choice== colour:
# print("well done")
#else:
# clue =clues(choice,colour)
# print(clue)
# choice = input("pick a colour from the list")
# while choice!= colour:
# choice = int(input("pick a colour from the list"))
# clue =clues(choice,colour)
# if choice== colour:
# print("well done")

#import turtle
#for i in range(4):
# turtle.forward(100)
# turtle.left(90)

#import turtle
#scr = turtle.Screen()
#turtle.circle(80)

#import turtle
#for i in range(3):
# turtle.forward(100)
# turtle.left(120)
#import turtle
#window = turtle.Screen()
#turtle.bgcolor("white")
#colours= ["red","green","blue"]
#
#for i in range(3):
# turtle.fillcolor(colours[i])
# turtle.begin_fill()
# turtle.pendown()
# for i in range(3):
# turtle.forward(100)
# turtle.left(120)
# turtle.end_fill()
# turtle.penup()
# turtle.forward(200)

#import turtle
#for i in range(5):
# turtle.forward(100)
# turtle.right(144)

#import turtle
#turtle.speed(1)
#window = turtle.Screen()
#turtle.bgcolor("white")
#turtle.left(90)
#turtle.forward(200)
#turtle.right(90)
#turtle.penup()
#turtle.forward(100)
#turtle.pendown()
#turtle.forward(250)
#turtle.right(90)
#turtle.forward(100)
#turtle.right(90)
#turtle.forward(250)
#turtle.left(90)
#turtle.forward(100)
#turtle.left(90)
#turtle.forward(250)
#turtle.penup()
#turtle.forward(100)
#turtle.pendown()
#turtle.forward(250)
#turtle.left(90)
#turtle.forward(100)
#turtle.left(90)
#turtle.forward(200)
#turtle.backward(200)
#turtle.right(90)
#turtle.forward(100)
#turtle.left(90)
#turtle.forward(250)

#import random
#import turtle
#colours = ["red","yellow","black","blue","green","pink"]
#for i in range(8):
# colour = random.choice(colours)
# turtle.color(colour,"red")
# turtle.forward(100)
# turtle.right(45)

#import random
#import turtle
#for i in range(random.randint(1,100)):
# turtle.forward(random.randint(1,100))
# turtle.right(random.randint(1,100))

#countries_tuple=("england","china","italy","korea","usa")
#print(countries_tuple)
#country = input("?")
#print(countries_tuple.index(country))
#index =int(input(">"))
#print(countries_tuple[index])

#sports = ["football","basketball"]
#sport = input("?")
#sports.append(sport)
#print(sorted(sports))

#subjects = ["maths","english","physics","chemistry","biology","art"]
#print(subjects)
#subject = input("?")
#subjects.remove(subject)
#print(subjects)

#foods = {}
#for i in range(1,5,1):
# food = input("what is one of you favourite foods")
# foods[i]=food
#print(foods)
#delete = int(input("which do u wanna get rid of"))
#foods[delete]=""
#print(sorted(foods))

#colours =
["red","yellow","black","blue","green","pink","orange","white","cyan","brown"]
#start = int(input("?"))
#end = int(input("?"))
#print(colours[start:end+1])

#numbers = [369,277,121]
#for i in range(3):
# print(numbers[i])
#number = int(input("?"))
#if number in numbers:
# print(numbers.index(number))
#else:
# print("number not in list")

#party = []
#for i in range(3):
# p = input("who do u want to add")
# party.append(p)
#print(party)
#more = True
#while more == True:
# p = input("who do u want to add, say no if no more")
# if p =="no":
# more = False
# else:
# p = input("who do u want to add")
#print(party)
#delete = int(input("which do u wanna get rid of"))
#party[delete]=""
#print(sorted(party))

#tv = ["game of thrones","power","breaking bad","riverdale"]


#print(tv)
#show = input("what show do u want to add")
#place = int(input("where"))
#tv.insert(place,show)
#print(tv)

#nums =[]
#for i in range(3):
# num = int(input("?"))
# nums.append(num)
# print(nums)
#delete = input("do u still want the last number")
#if delete == "no":
# nums.remove(num)
# print(nums)
#else:
# print(nums)

#name = input("what is your name")


#print(len(name))
#name2 = input("what is your surname")
#print(len(name2))
#full = name+ name2
#print(len(full)+1)

#subject = input("what is your fave subject")


#for letter in subject:
# print(letter,end="*")

#poem =list("Deep into that darkness peering, long I stood there wondering,
fearing")
#start = int(input("starting point"))
#end = int(input("ending point"))
#poem =poem[start,end]
#poem = "".join(poem)

#word = input("type a word in upper case")


#while not word.isupper():
# word = input("type a word in upper case")

#code = input("enter postcode")


#code = list(code)
#code[0]= code[0].upper()
#code[1]= code[1].upper()
#code = "".join(code)
#print(code)

#name = input("name?")
#num = 0
#for char in name:
# if char in "aeiou":
# num = num+1
#print(num)

#pass1 = input("enter a password")


#pass2 = input("enter it again")
#if pass1 == pass2:
# print("thank you")
#elif pass1.lower() = pass2.lower():
# print("must be in same case")
#else:
# print("incorrect")

#word = input("enter a word")


#length = len(word)
#word = list(reversed(word))
#for i in range(5):
# print(word[i])

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy