Questions tagged [mario.py]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
50 views

Struggling to align pyramid and check for extra spaces at the end of each line in pset6 mario.py less

I'm struggling to meet these specifications - "Be sure that the pyramid is aligned to the bottom-left corner of your terminal, and that there are no extra spaces at the end of each line." ...
0
votes
1answer
64 views

What are the requirements for Week 6 Mario (more)? My code works but the grade book shows only 96% completeness

I tried two different variations but both reach 96% completeness code 1: from cs50 import get_int while True: height = get_int("Height: ") if height < 9 and height > 0: break ...
0
votes
0answers
23 views

How to avoid extra line after the input from user

from cs50 import get_int import sys height = get_int("Height: ") if height > 8 or height < 1: print("invalid input") exit(1) else: for i in range(0, height+1): for j in ...
0
votes
1answer
35 views

Check does not like my spacing on Mario.sentimental. Is the program unwilling to print ' ' * 0 as no spaces?

I've run this in various configurations, when I remove excess spaces, it still prints out with a space at the beginning of each line. And the center spacing seems to be larger than check50 expects, ...
0
votes
1answer
49 views

pset6 mario.py the hashes is shifted to the left instead to the right. And it does not give me the message if I type -8 or any word. Please help

from cs50 import get_int print("height: ",end="") height = get_int() while True: # prompt user for height if height >= 0 or height <= 23: break else: print("retry!!!"...
0
votes
1answer
45 views

why is there a blank line after input?

import cs50 `while True:` ` n = cs50.get_int("enter size:")` ` if n >= 0 and n <= 100 :` ` break` for i in range(n + 1): print(" " *(n - i), end ='') print("#" * i, end = ''...
0
votes
1answer
238 views

pset6 - mario more - check50 EOF error

My pset6's mario-more Python implementation works fine. However, check50 is returns the following errors: :( handles a height of 0 correctly / did not find EOF :( handles a height of 23 ...
0
votes
1answer
154 views

pset6 mario(more).py check50 problems even when output is correct?

Working on mario (more).py port into python. My code works and it seems to output the correct things, but check50 does not like it. Can anyone point me in the right direction of where I am incorrect?
0
votes
1answer
53 views

mario.py builds pyramid for > 23 even though condition set to <= 23

I've tried to get better re: testing not just for a successful result, but for the behavior I want for any given input. My code looks ok to me, but it's building the pyramid even when height > 23. It ...
0
votes
1answer
2k views

pset6 mario.py more

please please please, i am going insane, I thought python was supposed to be easier, but i can not for the life of me figure out what the hell is wrong with my code, i didn't sleep at all last night ...
0
votes
1answer
67 views

In pset6, have an error right from the start with mario.py

Here is my code so far in its entirety: import cs50 def main(): I immediately had an error (red dot with x next to def main): unexpected EOF while parsing I like that python notifies right away ...
0
votes
1answer
1k views

Simple Python Loop Not Working

I'm converting the more comfortable version of mario.c to Python3 and cannot get the following loop to work: running = True while running: print("Height: ", end="") height = cs50.get_int() ...
0
votes
1answer
225 views

How do I add a condition to a for() loop in Python?

I'm porting crack.c to crack.py. I crack.c, I am able to do this: for (int i = 0; i < sizeof(letters) && strcmp(hash, solve) != 0; i++) In order to break the for() loop if I find the ...
0
votes
1answer
1k views

cs50 2017 pset6 - mario.py code not working

I am working on mario.py and the code compiles, except when I run it, it keeps prompting the user for an integer and does not print out the pyramid. I know that there is something incorrect with the ...
0
votes
1answer
1k views

CS50 2017 ProblemSet6 Mario.py

What is the problem with this simple code? I'm new with Python Also I know Python doesn’t have a do while loop, so instead I use while True, but break, or stop the loop, if n < 0 or n > 23: ...