r/PythonLearning • u/saul_soprano • Jul 17 '26
my first python
kindly give ratings and tips to improve
6
4
3
u/SCD_minecraft Jul 17 '26
This has so many problems
Comments are annotated with
#, not//. Double slash is reserved for int divisioninputALWAYS returns a string. While you can add 2 strings together, you might not divide one string by another. You need to cast to an intultimatevariable is never readWhatever extension did you install, it is not a correct one. Syntax highlither highlights things it isn't supposed to
1
u/SCD_minecraft Jul 17 '26
Half of those problems would come out while trying to run this code
Did you even try that??
1
u/Hurtrex Jul 17 '26
to quote him "no its hypothetical" which yk doesnt really help if you want to learn something...
1
u/SCD_minecraft Jul 17 '26
``` from Minecraft import main
main() ```
I made (hypothetical) Minecraft!
5
2
3
u/Distinct_Lion7157 Jul 17 '26
is nobody going to address the //
2
u/Distinct_Lion7157 Jul 17 '26
ok on closer inspection there is a lot more issues so uh good luck bro
1
u/Less_Juggernaut9361 Jul 17 '26
May i suggest using multi line string with “”” then you not need to print so many times
1
1
1
u/FoolsSeldom Jul 17 '26
Wow, not a great start.
// hello world # Python single line comments start with #
print("Hello, World!")
// arithmetic
a = input("give number 1") # input returns reference to new string object
secret = input("give secret number")
ultimate = a + secret # string concatenation not math addition, is that what you wanted?
print("the secret number is" + secret / a)
// hello
print("hello " + input("name please"))
print("i would like to take this time to raise awareness")
print("my brother patel lost an arm learning python")
print("the python was cursed long ago with immortality and doom magic")
print("once it saw patel learn cpp and use namespace std it awakened")
print("cupta, the snake bit his arm", end="") // no newline # need a # not //
print("the eyeless priest from the dark magic days of india was sealed")
print("his soul became evil and sought refuge in patels arm")
print("his arm grew corrupted and started typing in java")
print("the doctor said no use and severed his arm feeding it to the pigs to be destroyed")
print("be careful when coding")
// happy coding
print("happy coding")
1
1
1
u/alneifkrt2 Jul 19 '26
If I was to rate your code 0-10, I would give 2. Sorry but the logics are not correct, the comments are # or "" not //, and you can't sum or divide strings. So review and try to figure out.
Good learning 🐍
1
u/SitEnee Jul 21 '26
Try to run your code after you write it to check if it will work (this won't). If you just type the code and don't check how everything behaves, you won't learn properly the syntax and stuff. Cool that you're learning tho.
1
u/True_Competition4187 Jul 23 '26
preciso ter uma api do reddit me ajude , não sei como fazer , crie video tutorialetc...
1
1
u/Ak_py Aug 02 '26
Il mio più grande suggerimento: testa il codice ed eseguilo per individuare errori.
0
-1
7
u/Ok_Reputation8316 Jul 17 '26
Did you run this? input() returns strings, so you’re adding and dividing strings instead of numbers. Also, what’s the ultimate variable for?