2
votes
2
votes
Accepted
Python Caesar not working for mix case etc
Multiple things.
if plaintext.isupper():
you meant i.isupper(). plaintext.isupper() would check whether the whole string is upper-case, which it is not, but it also isn't completely lower-case, so ...
1
vote
Accepted
Readability CS50 Not counting the spaces
string input = get_string("Text:"); //getting input from the user
int len = strlen(input); //determining the length of the string
int space = 0; //declaring a variable to count whitespaces
...
1
vote
Accepted
Struggling to align pyramid and check for extra spaces at the end of each line in pset6 mario.py less
Don't make things complicated.
for x in range (height):
print((height-x - 1)*' ' + (x+1)*'#')
1
vote
Accepted
Can't properly check mario.c less comfortable, something wrong with spacing
Your staircase has the stairs going down to the right. They're supposed to go up from the left. Perhaps a review of the assignment specification is in order?
There's a second problem lying in wait, ...
1
vote
Accepted
PSET 1 Mario calculating spaces
You don't need it to be height-i-1 and you can just do height-i
Your hashes can be i+1 rather than i+2
If you do this, I think it will work as planned.
Hope this helps,
Ian
1
vote
What is the difference between 'printf(" ");' and 'printf("%s"," ");'?
They should work exactly the same. printf(" "); will print a single space, the content between the double quotes. printf("%s"," ") will grab the first parameter " "after the format string, "%s" and ...
Only top scored, non community-wiki answers of a minimum length are eligible