Skip to content

Instantly share code, notes, and snippets.

@mhassanist
Last active October 15, 2021 06:21
Show Gist options
  • Save mhassanist/bcdbaad67bb58e85aee2a7c54e932ec2 to your computer and use it in GitHub Desktop.
Save mhassanist/bcdbaad67bb58e85aee2a7c54e932ec2 to your computer and use it in GitHub Desktop.
#DON'T just look at the code or copy it. Solve it yourself first
import turtle
rex = turtle.Turtle()
rex.color("green")
radius = int(input("Enter the radius of the circle: "))
rex.circle(radius)
##############################
user_input = input('Enter a number: ')
x = int(user_input)
if x == 4 :
print('It\'s 4')
print('It\'s four')
else:
print("It's not 4")
##############################
#https://stackoverflow.com/questions/5424716/how-to-check-if-string-input-is-a-number
#https://docs.python.org/3/library/stdtypes.html#str.isdigit
num = 4
guessed_num = int(input('please input your guessed number: '))
if guessed_num == num:
print('Yay! You guessed correctly')
elif guessed_num > num:
print('Your number is greater that mine')
else:
print('Your number is smaller that mine')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment