Skip to content

Instantly share code, notes, and snippets.

@SeePetulaCode
Last active January 2, 2019 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeePetulaCode/fa8dfa4cdcd364dff905c3a7a831e391 to your computer and use it in GitHub Desktop.
Save SeePetulaCode/fa8dfa4cdcd364dff905c3a7a831e391 to your computer and use it in GitHub Desktop.
import random
import sys
import os
def numbers(x):
for i in range(x):
if i % 2 == 0:
yield i
listNums = list(numbers(11))
print(listNums[1:])
#-------------------------------------------------
def make_word():
word = ""
for ch in "spam-a-lot":
word += ch
yield word
print(list(make_word()))
# -------------------------- Sets ----------------
nums = {"a", "b", "c", "d"}
nums.add("e")
totalNums = len(nums)
print(" Totsl numbers in the set are: " + str(totalNums))
'''
name = input("Enter name: ")
print("hello " + name +"!")
#this is a comment
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment