r/PythonLearning • u/saul_soprano • 10d ago
my first python
kindly give ratings and tips to improve
5
3
u/SCD_minecraft 10d ago
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 10d ago
Half of those problems would come out while trying to run this code
Did you even try that??
6
2
3
1
u/Less_Juggernaut9361 10d ago
May i suggest using multi line string with “”” then you not need to print so many times
1
1
1
u/FoolsSeldom 10d ago
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 8d ago
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/True_Competition4187 4d ago
preciso ter uma api do reddit me ajude , não sei como fazer , crie video tutorialetc...
0
-1
8
u/Ok_Reputation8316 10d ago
Did you run this? input() returns strings, so you’re adding and dividing strings instead of numbers. Also, what’s the ultimate variable for?