Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Brand new to programming
#1
I am a newbie and have a question. I am following a guide and typed a few line and ran with Python 3.7 on a Mac. When I run it some of the output prints the parenthesis. What and I doing wrong?
Here's the code:
print("I will now count my chickens:")
print("Hens", 25 + 30 / 6)
print("Roosters", 100 - 25 * 3 % 4)

print("Now I will count the eggs:")

print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6) 
print("Is it true that 3 + 2 < 5 - 7?")
print(3+2<5-7)
print("What is 3 + 2?", 3+2)
print("What is 5 - 7?",5-7)
print("Oh, that's why its False.")
print("How about some more.")
print("Is it greater?" ,5>-2)
print("Is is greater or equal?", 5>=-2)
print("Is it less or equal?",5<=-2)
Hers the run:
I will now count my chickens:
('Hens', 30)
('Roosters', 97)
Now I will count the eggs:
7
Is it true that 3 + 2 < 5 - 7?
False
('What is 3 + 2?', 5)
('What is 5 - 7?', -2)
Oh, that's why its False.
How about some more.
('Is it greater?', True)
('Is is greater or equal?', True)
('Is it less or equal?', False)


I'm sure it's something stupid. Thank you in advance. Also if this is the wrong place to post please point me in the right direction.
Reply


Messages In This Thread
Brand new to programming - by joelarrabee - Sep-17-2018, 12:57 AM
RE: Brand new to programming - by ichabod801 - Sep-17-2018, 01:23 AM
RE: Brand new to programming - by joelarrabee - Sep-17-2018, 01:47 AM
RE: Brand new to programming - by ichabod801 - Sep-17-2018, 02:03 AM
RE: Brand new to programming - by pcsailor - Sep-17-2018, 03:03 AM
RE: Brand new to programming - by joelarrabee - Sep-17-2018, 03:16 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020